Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PLS-00225: subprogram or cursor reference is out of scope: REF CURSOR required?
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 DBAReceived on Wed Jun 14 2006 - 12:42:18 CDT