UPDATE statement in CURSORS
441258May 10 2005 — edited May 10 2005declare
cursor d is
select Name, Age from Rem1 where Name = 'Santosh' for update of Age;
record d%ROWTYPE;
begin
OPEN d;
loop
FETCH d into record;
EXIT when d%NOTFOUND;
begin
update Rem1 set Age = 30 where CURRENT of d;
insert into Keeper values(record.Name, record.Age);
commit;
EXCEPTION
when others then
rollback;
end;
end loop;
CLOSE d;
end;
I just wanted to know whether can we issue multiple update statements inside a cursor. In the above SQL block I have given a single update statement. Can I update another field inside this CUSOR itself?
Thanx in advance