Tuesday, June 19, 2018

Using cursor write a pl/sql block to give 5% raise on salary to every employee - DBMS (Cursor)

declare
cursor abc is select * from salary;
rec abc%rowtype;
begin
open abc;
loop
fetch abc into rec;
exit when abc%notfound;
update salary set salary1=(salary1+rec.salary1*0.05) where emp_no=rec.emp_no;          
end loop;
close abc;
end;

No comments:

Post a Comment