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: PLS-00225: subprogram or cursor reference is out of scope: REF CURSOR required?

Re: PLS-00225: subprogram or cursor reference is out of scope: REF CURSOR required?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 14 Jun 2006 19:42:18 +0200
Message-ID: <nji092lt1etk42addcbgaqeb8ic615ob8e@4ax.com>


On 14 Jun 2006 09:30:11 -0700, chilecayenne_at_yahoo.com wrote:

>
>I thought you could use one cursor's fields in another cursor, as long
>as it was declared after the primary one....

No you can't, as a cursor is nothing more than a pointer to a piece of memory.
You need to fetch the cursor in a *record*, which can be bound to the cursor as follows

cursor c1 is ... etc

r1 c1%rowtype;

You can refer to the components of a record in a cursor definition. A cursor definition can also have *parameters*, just as procedures and functions.

Why you until now used a REF CURSOR beats me. Probably because you are unfamiliar with the PL/SQL reference manual, in which this is all documented.

--
Sybrand Bakker, Senior Oracle DBA
Received on Wed Jun 14 2006 - 12:42:18 CDT

Original text of this message

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