Bonsoir à tout le monde
Mon probleme est le suivant
j'ai deux curseurs et je voudrai à partir des resultats du premier parcourrir le second, faire des tests de compraraison et en fonction de ce test effectuer des mises à jours ou des insertions dans une table d'un autre utilisateur du meme schema
voici mon code
SET SERVEROUTPUT ON
declare
cursor sidy is
select txnlpatterna as MOBILE, billed_duration as duree, callbnumber as destination FROM CONSO_2007 partition(M2007_06)
where (callbnumber ='APPEL INTERCEL GSM' or
callbnumber ='APPEL SOTELGUI GSM' or
callbnumber ='APPEL ORANGE' or
callbnumber ='AREEBA' or
callbnumber ='APPEL CELLCOM' or
callbnumber ='APPEL INTERNATIONAL')
and (billed_duration>='60') and (bevtid1 in(1,2)) and (bltpid=2);
phone CONSO_2007.txnlpatterna%type;
calltime CONSO_2007.billed_duration%type;
destiny CONSO_2007.callbnumber%type;
cursor exemple is select mobile, duree, detination from sidy.exemple;
phone1 sidy.exemple%type;
calltime1 sidy.exemple%type;
destiny1 sidy.exemple%type;
begin
open sidy;
loop
fetch sidy into phone, calltime, destiny;
open exemple;
loop
fetch exemple into phone1, calltime1, destiny1;
if (phone1=phone) then
update sidy.exemple set sidy.exemple.duree=calltime1+calltime where
sidy.exemple.mobile=phone1;
else
insert into SIDY.EXEMPLE (MOBILE, DUREE, DETINATION) VALUES(phone,calltime,destiny);
end if;
exit when exemple%NOTFOUND;
end loop;
close exemple;
exit when sidy%NOTFOUND;
end loop;
close sidy;
end;
voici les erreurs générées
phone1 sidy.exemple%type;
*
ERREUR à la ligne 16 :
ORA-06550: line 16, column 8:
PLS-00225: subprogram or cursor 'SIDY' reference is out of scope
ORA-06550: line 16, column 8:
PL/SQL: Item ignored
ORA-06550: line 17, column 12:
PLS-00225: subprogram or cursor 'SIDY' reference is out of scope
ORA-06550: line 17, column 12:
PL/SQL: Item ignored
ORA-06550: line 18, column 11:
PLS-00225: subprogram or cursor 'SIDY' reference is out of scope
ORA-06550: line 18, column 11:
PL/SQL: Item ignored
ORA-06550: line 25, column 21:
PLS-00320: the declaration of the type of this expression is incomplete or
malformed
ORA-06550: line 25, column 1:
PL/SQL: SQL Statement ignored
ORA-06550: line 26, column 5:
PLS-00320: the declaration of the type of this expression is incomplete or
malformed
ORA-06550: line 26, column 1:
PL/SQL: Statement ignored
j'espere que les genies du pl/sql prendrons leur temps pour m'apporter leur aide. Merco d'avance.
Partager