set serveroutput on
declare
VEno Emp.Eno%TYPE;
VESalary Emp.ESalary%TYPE;
cursor cremp is
select Eno, ESalary from Emp;
begin
open cremp;
loop
fetch cremp into VEno,VESalary;
exit when cremp%NOTFOUND;
update Emp set ESalary = VESalary - VESalary * 0.05 where Eno = VEno;
end loop;
close cremp;
end;
/
commit;
/
No comments:
Post a Comment
Thanks for showing your interest
I will shortly get back to you