Tuesday, June 19, 2018

Using cursor only update first two row where NO=NO*10 - DBMS (Cursor)


declare
cursor abc is select no,name from empmaster;
rec abc%rowtype;
begin
if abc%isopen
then
open abc;
end if;
for rec in abc
loop
exit when abc%rowcount>2 or abc%notfound;
update empmaster set no=no*10 where no=rec.no;
end loop;
end;

No comments:

Post a Comment