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: Fields in variable cursor

Re: Fields in variable cursor

From: Tony Dare <tonydare_at_yahoo.com>
Date: Wed, 07 Jul 2004 23:27:10 -0700
Message-ID: <%Y5Hc.57$z9.53@news.oracle.com>


Oracle Newbie wrote:
> "Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message
> news:1089258972.310319_at_yasure...
>

>>Oracle Newbie wrote:
>>
>>>A stored procedure has returned a variable cursor (say rsg ). Now in SQL
>>>Plus how can I access the fields or columns of the record ?
>>>Is'nt there something like rsg(1) etc. and even if I know the field

>
> names
>
>>>rsg.ename doesnt work.
>>>
>>>thx.
>>>
>>>SQL> DECLARE
>>>  2    TYPE rfc IS REF CURSOR;
>>>  3    rsg rfc;
>>>  4    ename varchar(15);
>>>  5
>>>  6
>>>  7  BEGIN
>>>  8     emp_grade.GetEGrade(18,rsg);   /* rsg is an output cursor

>
> parameter
>
>>>*/
>>>  9
>>> 10     dbms_output.put_line(rsg.ename);
>>> 11  END;
>>> 12  /
>>>   dbms_output.put_line(rsg.ename);
>>>                            *
>>>ERROR at line 10:
>>>ORA-06550: line 10, column 29:
>>>PLS-00487: Invalid reference to variable 'RSG'
>>>ORA-06550: line 10, column 4:
>>>PL/SQL: Statement ignored
>>
>>I am at a complete loss to understnd what it is you are trying to do.

>
>
> Just learning to pass/return cursor variables.
>
>
>>You declared a REF CURSOR? Why you did it as you did I have no idea
>>(in the future use SYS_REFCURSOR)

>
>
> What's the difference between SYS_REFCURSOR and REF CURSOR?
>
>
>>but at this point it is just a
>>declaration of a variable: Nothing more.
>>
>>Look at this:
>>http://www.psoug.org/reference/ref_cursors.html
>>
>>For an example of working with and declaring ref cursors.

>
>
>>Daniel Morgan
>>

>
>
>

http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/08_subs.htm#20682

has the answer you're after. Had to look it up meself...:) Thanks Mr. Morgan, I can use that.

td Received on Thu Jul 08 2004 - 01:27:10 CDT

Original text of this message

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