declare
cursor c1(dno number) is select empno from emp where detpno=dno;
pempno emp.empno%type;
begin
open c1(10);
loop
fetch c1 into pempno;
exit when c1%notfound;
update emp set sal = sal +100 where empno=pempno;
end loop;
close c1;
commit;
end;
/
cursor c1(dno number) is select empno from emp where detpno=dno;
pempno emp.empno%type;
begin
open c1(10);
loop
fetch c1 into pempno;
exit when c1%notfound;
update emp set sal = sal +100 where empno=pempno;
end loop;
close c1;
commit;
end;
/