Home » SQL & PL/SQL » SQL & PL/SQL » Sys ref cursor in for loop
Sys ref cursor in for loop [message #219438] Wed, 14 February 2007 07:05 Go to next message
vp17in
Messages: 12
Registered: November 2006
Junior Member
l_new_rel_cur is a SYS_REFCURSOR.

Can I use for loop to iterate through the sys ref cursor like this.

FOR i IN l_new_rel_cur.FIRST .. l_new_rel_cur.LAST
LOOP
FETCH l_new_rel_cur INTO rel_id;
END LOOP;
Re: Sys ref cursor in for loop [message #219527 is a reply to message #219438] Wed, 14 February 2007 14:32 Go to previous messageGo to next message
flyboy
Messages: 1832
Registered: November 2006
Senior Member
You can, but not as you stated.
Follow the example in documentation.
icon14.gif  Re: Sys ref cursor in for loop [message #219551 is a reply to message #219438] Wed, 14 February 2007 22:59 Go to previous messageGo to next message
vp17in
Messages: 12
Registered: November 2006
Junior Member
Thanks for the link flyboy
Re: Sys ref cursor in for loop [message #219613 is a reply to message #219438] Thu, 15 February 2007 02:53 Go to previous messageGo to next message
vp17in
Messages: 12
Registered: November 2006
Junior Member
But I heard the way I had suggested is possible. Is that true?

Can we iterate like I had give in my first post in this thread.
Re: Sys ref cursor in for loop [message #219653 is a reply to message #219613] Thu, 15 February 2007 05:09 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
No. First and Last are properties of collections, not ref cursors.
Re: Sys ref cursor in for loop [message #219691 is a reply to message #219438] Thu, 15 February 2007 09:55 Go to previous message
vp17in
Messages: 12
Registered: November 2006
Junior Member
Thanks for the confirmation.
Previous Topic: Drop object type that is marked for delete
Next Topic: CLOB COLUMNS
Goto Forum:
  


Current Time: Sat Dec 10 14:44:40 CST 2016

Total time taken to generate the page: 0.08159 seconds