Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Too Many Cursors?
Helge Moulding wrote:
> What I'm really after is help figuring out how to get a function to
> return a ref cursor without complaining that I've got too many
> cursors open. I sort of assumed that a cursor is closed automatically
> when it goes out of scope, but maybe that isn't right?
Correct. Ref cursors are -never- out of scope. A PL/SQL proc can create a ref cursor (which is nothing but a pointer to a structure in the PGA). PL/SQL proc terminates and passed that pointer to a VB client. The VB client can now step through the cursors, processing it.
The ref cursor struct and resources are only released when the session owning that ref cursor pointer terminates, or when the ref cursor is explicitly closed (e.g. using the PL/SQL call CLOSE).
-- BillyReceived on Tue Oct 04 2005 - 04:03:31 CDT
![]() |
![]() |