Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

UPDATE statement in CURSORS

441258May 10 2005 — edited May 10 2005
declare
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

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 7 2005
Added on May 10 2005
2 comments
144 views