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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
| DECLARE
cursor emp_cursor is select * from employe where matricule = :txt_matricule or (lower(nomemp) = lower(:txtnom) and lower(prenomemp) = lower(:txtprenom));
row_emp emp_cursor%rowtype;
cursor conj_cursor is select * from conjoint where matricule = :txt_matricule or matricule in (select matricule from employe where lower(nomemp) = :txtnom and lower(prenomemp) = lower(:txtprenom) );
row_conj conj_cursor%rowtype;
cursor enf_cursor is select * from enfant where matricule = :txt_matricule or matricule in (select matricule from employe where lower(nomemp) = lower(:txtnom) and lower(prenomemp) = lower(:txtprenom) );
row_enf enf_cursor%rowtype;
cursor contrat_cursor is select * from contrat where matricule = :txt_matricule or matricule in (select matricule from employe where lower(nomemp) = lower(:txtnom) and lower(prenomemp) = lower(:txtprenom) );
row_contrat contrat_cursor%rowtype;
cursor rec_cursor is select a.numcmim, b.numcimr, c.numcnss, c.dateaffectation from cmim a, cimr b, cnss c
where a.matricule = :txt_matricule or a.matricule in (select matricule from employe where lower(nomemp) = lower(:txtnom) and lower(prenomemp) = lower(:txtprenom))
and b.matricule = :txt_matricule or b.matricule in (select matricule from employe where lower(nomemp) = lower(:txtnom) and lower(prenomemp) = lower(:txtprenom))
and c.matricule = :txt_matricule or c.matricule in (select matricule from employe where lower(nomemp) = lower(:txtnom) and lower(prenomemp) = lower(:txtprenom)) ;
row_rec rec_cursor%rowtype;
cursor cmpt_cursor is select * from comptebancaire where matricule = :txt_matricule or matricule in (select matricule from employe where lower(nomemp) = lower(:txtnom) and lower(prenomemp) = lower(:txtprenom));
row_cmpt cmpt_cursor%rowtype;
cursor rem_cursor is select * from remuneration where matricule = :txt_matricule or matricule in (select matricule from employe where lower(nomemp) = lower(:txtnom) and lower(prenomemp) = lower(:txtprenom)) and numfct = row_fct.numfct;
row_rem rem_cursor%rowtype;
cursor formation_cursor is select * from formations where matricule = :txt_matricule or matricule in (select matricule from employe where lower(nomemp) = lower(:txtnom) and lower(prenomemp) = lower(:txtprenom));
row_formation formation_cursor%rowtype;
nument employe.numentite%type;
numdep entite.numdept%type;
numdir departement.numdirection%type;
nfct fonction.numfct%type;
BEGIN
open emp_cursor;
fetch emp_cursor into row_emp;
select numentite into nument from employe where matricule = :txt_matricule or matricule in (select matricule from employe where lower(nomemp) = :txtnom and lower(prenomemp) = lower(:txtprenom) );
select numdept into numdep from entite where numentite= nument;
select numdirection into numdir from departement where numdept = numdep;
select numfct into nfct from fonction where numentite = nument;
open conj_cursor;
fetch conj_cursor into row_conj;
open enf_cursor;
fetch enf_cursor into row_enf;
open contrat_cursor;
fetch contrat_cursor into row_contrat;
open rec_cursor;
fetch rec_cursor into row_rec;
open cmpt_cursor;
fetch cmpt_cursor into row_cmpt;
open rem_cursor;
fetch rem_cursor into row_rem;
open formation_cursor;
fetch formation_cursor into row_formation;
:cinemp := row_emp.cinemp;
:nomemp := row_emp.nomemp;
:prenomemp := row_emp.prenomemp;
:dtnaissemp := row_emp.dtnaissemp;
:sitfamilialeemp := row_emp.sitfamilialeemp;
:sexeemp := row_emp.sexeemp;
:adremp := row_emp.adremp;
:telemp := row_emp.telemp;
:anc := row_emp.anc;
:cincjt := row_conj.cincjt;
:nomcjt := row_conj.nomcjt;
:prénomcjt := row_conj.prénomcjt;
:dtnaisscjt := row_conj.dtnaisscjt;
:fctcjt := row_conj.fctcjt;
:prenomenfant := row_enf.prenomenfant;
:dtnaissenfant := row_enf.dtnaissenfant;
:gradeenfant := row_enf.gradeenfant;
:numcontrat := row_contrat.numcontrat;
:typecontrat := row_contrat.typecontrat;
:datedebutcontrat := row_contrat.datedebutcontrat;
:datefincontrat := row_contrat.datefincontrat;
:numcimr := row_rec.numcimr;
:numcmim := row_rec.numcmim;
:numcnss := row_rec.numcnss;
:dateaffectation := row_rec.dateaffectation;
:numcompteb := row_cmpt.numcompteb;
:nombanque := row_cmpt.nombanque;
:adresseagenceb := row_cmpt.adresseagenceb;
:rib := row_cmpt.rib;
:datedebutfct := row_rem.datedebutfct;
:salaire := row_rem.salaire;
:dateremuneration := row_rem.dateremuneration;
:datefinfct := row_rem.datefinfct;
:niveauetude := row_formation.niveauetude;
:diplome := row_formation.diplome;
:typeetablissement := row_formation.typeetablissement;
:nometablissement := row_formation.nometablissement;
select nomentite into :nomentite from entite where entite.numentite = nument;
select nomdept into :nomdept from departement where departement.numdept = numdep;
select nomdirection into :nomdirection from direction where numdirection = numdir;
select libellefct,catfct into :libellefct, :catfct from fonction where numentite=nument;
close formation_cursor;
close rem_cursor;
close fct_cursor;
close dir_cursor;
close dept_cursor;
close cmpt_cursor;
close rec_cursor;
close contrat_cursor;
close enf_cursor;
close conj_cursor;
close emp_cursor;
end; |
Partager