[Cursor/Function]Comment faire correctement la mise en place
Voici m'a fonction et un curseur est ce que quelqu'un pourrai m'expliquer comment faire clairement le truc
Merci
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| CREATE OR REPLACE Function Repdossier (w_dossier, w_soccible) return string;
is
resultat
Begin
update ADMINISTRATIF set ACTID = w_soccible where dosid=w_dossier;
update DOSSIER set ACTIDGESTION = w_soccible where dosid=w_dossier;
update LKDOSRUBPOOACT set ACTID = w_soccible where dosid=w_dossier;
update TVADECLARATION set ACTID = w_soccible where actid=w_actid;
update TVA set ACTID = w_soccible where dosid=w_dossier;
update TVADETAIL set ACTID = w_soccible where dosid=w_dossier;
update AUDITECRITURE set AECACTCODESC = w_soccible where dosid=w_dossier;
update AUDITECRITURE set AECEMPACTCODESOC = w_soccible where dosid=w_dossier; |
ET maintenant le curseur
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Declare
Cursor CActeur is Select Actid from where dosid = w_dossier;
w_act Varchar;
Begin
Open Cacteur;
Loop
Fetch CActeur into w_act
exit when (CActeur%Notfound)
End loop;
close CActeur;
End; |