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!

%ISOPEN: Always FALSE for implicit cursors

Sreekanth MunagalaJul 30 2010 — edited Jul 30 2010
Hi Friends,

As mentioned in the subject, PL/SQL Reference guide says that %ISOPEN is always FALSE for implicit cursors.
But does this hold true in case of Implicit Cursors - FOR loop?
For a FOR loop, a cursor is automatically closed when we leave the loop.
So as long as we are in the loop, the cursor will be open and SQL%ISOPEN should return TRUE.But it is returing false as shown below:
BEGIN 
FOR i IN (SELECT * FROM scott.emp) 
LOOP 
IF SQL%ISOPEN THEN 
dbms_output.put_line('Empno -> '||i.empno); 
ELSE 
dbms_output.put_line('Implicit Cursor is CLOSED'); 
END IF; 
END LOOP; 
END;
Regards,
Sreekanth Munagala.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 27 2010
Added on Jul 30 2010
4 comments
2,943 views