declare
cursor c is
select * from emp for update;
v_temp c%rowtype;
begin
for v_temp in c loop
if(v_temp.sal<2000) then
update emp set sal=sal*2 where current of c;
elsif(v_temp.sal=5000) then
delete from emp where current of c;
end if;
end loop;
commit;
end;
cursor c is
select * from emp for update;
v_temp c%rowtype;
begin
for v_temp in c loop
if(v_temp.sal<2000) then
update emp set sal=sal*2 where current of c;
elsif(v_temp.sal=5000) then
delete from emp where current of c;
end if;
end loop;
commit;
end;