Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Too Many Cursors?

Re: Too Many Cursors?

From: Billy <vslabs_at_onwe.co.za>
Date: 4 Oct 2005 02:03:31 -0700
Message-ID: <1128416611.542813.53190@g14g2000cwa.googlegroups.com>


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).

--
Billy
Received on Tue Oct 04 2005 - 04:03:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US