Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Delete in a Stored Procedure?
Are you doing something like...?
declare
cursor c_mycur
is select col1,col2,col3
from mytable
where col1 = myvalue;
v_col1 mytable.col1%type;
v_col2 mytable.col2%type;
v_col3 mytable.col3%type;
begin
open c_mycur;
loop
fetch c_mycur into
v_col1,v_col2, v_col3;
exit when c_mycur%notfound;
...
your processing
...
if <your delete condition> then
delete from mytable
where current of c_mycur;
end if;
end loop;
close c_mycur;
end;