Skip to Main Content

SQL & PL/SQL

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!

Implicit Cursor Attributes

re439367meOct 20 2005 — edited Oct 26 2005
Dear Sirs

consider the following pl/sql block

begin
update dept
set loc='NANSER'
where deptno=100;
if sql%notfound then --- cursor is closed, how can we reference its attribute, ---------------------------------------------should it not produce an error?
insert into dept(id,dname,loc)
(.....)
end if;
end;
/

Just I want to know is that the implicit cursor is closed at the time we reference its attribute. if we check sql%isopen, it will return false. but disunderstandably the next attribute is valid and do the right thing.
In explicit cursor when the cursor is closed. we can't retrieve any information associated with it through its attributes, if we do so, an error is returned
ora-1001. invalid cursor.

but this is not true for implicit cursor.

Please give me details.

Rehman Ghani
Karachi Pakistan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2005
Added on Oct 20 2005
4 comments
309 views