Your Ad Here

Tuesday, March 24, 2009

Adding Salary using Cursor

declare
cursor abc is select ename,sal,sal + 500 "Newsal" from emp;
rec abc%rowtype;
begin
open abc;
loop
fetch abc into rec;
exit when abc%notfound;
dbms_output.put_line('name' || rec.ename || 'salary' || rec.sal || rec.sal ||'new salary' || rec.Newsal);
end loop;
close abc;
end;

No comments: