I tried to update my table into field1 with the following pl sql procedure, the compilation and execution done without any error, put when I call this procedure the update didn't work I don't know why! I used (for update of .... current of) statement with the cursor and the code is below
create or replace procedure p1 is
r1 table1%rowtype;
r2 table2%rowtype;
cursor c1 is select * from table1 for update of field1;
cursor c2 is select * from table2;
begin
open c1;
loop <<outer>>
fetch c1 into r1;
open c2;
loop <<inner>>
fetch c2 into r2;
if condition then
dbms_output.put_line('ok');
update table1
set field1= 1
where current of c1;
end if;
exit when c2%notfound;
end loop inner;
close c2;
exit when c1%notfound;
end loop outer;
close c1;
end;
/
Note: the condition in the IF statement is correct because when I execute the procedure the statement (dbms_output.put_line('ok');) executed successfully each time the loop executed when I remove the update statement and (for update of....current of) statement, but when I put the update statement with (for update of....current of) statement with the same condition, the update statement doesn't work.