Tuesday, June 19, 2018

Write a pl/sql block that update SALARY of employee of a specified company Using parameter in cursor - DBMS (Cursor)

declare
cursor abc(cmp varchar2) is select * from temp where company=cmp;
rec abc%rowtype;
c varchar2(10);
begin
c:='&c';
open abc(c);
loop
fetch abc into rec;
exit when abc%notfound;
update temp set salary=salary+(salary*0.1) where no=rec.no;
end loop;
end;

No comments:

Post a Comment