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
|
DECLARE
TYPE recordTypeFlux IS RECORD
(
libelle tmp_type_flux.tf_libelle%TYPE,
code tmp_type_flux.tf_code%TYPE
);
rec recordTypeFlux;
CURSOR CurseurTypeFlux IS select tf_libelle , tf_code from tmp_type_flux;
CURSOR ExisteTypeFlux IS select * from type_flux where type_flux.code_type_flux = rec.code;
BEGIN
OPEN CurseurTypeFlux;
OPEN ExisteTypeFlux;
dbms_output.put_line('1');
LOOP
FETCH CurseurTypeFlux INTO rec;
EXIT WHEN CurseurTypeFlux%NOTFOUND;
If ExisteTypeFlux%NOTFOUND Then
update type_flux set libelle_type_flux = rec.libelle;
/* insert into type_flux(libelle_type_flux, code_type_flux) values (rec.libelle,rec.code); */
END If;
END LOOP;
CLOSE CurseurTypeFlux;
CLOSE ExisteTypeFlux;
COMMIT;
END; |