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
| Boucle DECLARE
CURSOR Niv2 IS
SELECT pid_0311,type_voie_s_0311,com_nme_0311, mot_direct_s_0311 FROM sdis_t1_0311 WHERE pid_0311 not IN (SELECT pid_s FROM recap_test);
pid sdis_t1_0311.pid_0311%type;
type_voie sdis_t1_0311.type_voie_s_0311%type;
com_nme sdis_t1_0311.com_nme_0311%type;
mot_directeur sdis_t1_0311.MOT_DIRECT_S_0311%type;
SELECT pid_h,type_voie_h,libelle_voie_h, mot_directeur_h FROM recap_test;
pid_h recap_test.PID_H%type;
type_voie_h recap_test.type_voie_h%type;
libelle_voie_h recap_test.LIBELLE_VOIE_H%type;
mot_directeur_h recap_test.MOT_DIRECTEUR_h%type;
begin
open niv2;
FOR c IN 1..3
Loop
FETCH Niv2 INTO type_voie, mot_directeur ;
DBMS_OUTPUT.PUT_LINE( c );
UPDATE RECAP_test SET(PID_S,TYPE_VOIE_S,LIBELLE_VOIE_S,MOT_directeur_S,niv_app_h_s,campagne)
=(SELECT PID_0311,type_voie_s_0311,COM_NME_0311,mot_direct_s_0311,2,campagne_s_0311
FROM sdis_t1_0311
WHERE type_voie_s_0311<> type_voie_h
AND MOT_DIRECt_s_0311=MOT_DIRECTEUR_h);
end loop;
close Niv2;
end; |