Path: news.easynews.com!core-easynews!newsfeed3.easynews.com!easynews.com!easynews!news.glorb.com!transit.nntp.hccnet.nl!reader.nntp.hccnet.nl!not-for-mail
From: Sybrand Bakker <sybrandb@hccnet.nl>
Newsgroups: comp.databases.oracle.misc
Subject: Re: Fields in variable cursor
Date: Wed, 07 Jul 2004 19:24:38 +0200
Reply-To: sybrandb@hccnet.nl
Message-ID: <cbcoe0hadfaqvg4g7pqag7fldclbvtjp3l@4ax.com>
References: <2l255gF7hpjvU1@uni-berlin.de>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 42
Organization: Hobby Computer Club News Network
NNTP-Posting-Date: 07 Jul 2004 17:24:37 GMT
NNTP-Posting-Host: 62.251.38.212
X-Trace: 1089221077 reader1.nntp.hccnet.nl 152 62.251.38.212
X-Complaints-To: abuse@hccnet.nl
Xref: core-easynews comp.databases.oracle.misc:111551
X-Received-Date: Wed, 07 Jul 2004 10:23:48 MST (news.easynews.com)

On Wed, 7 Jul 2004 16:30:33 +0500, "Oracle Newbie"
<f93c0532@yahoo.com> 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
>


You have defined a *weak* ref cursor. Those ref cursors are typeless.
So that is the reason why you can't refer to rsg.ename
Also you can't refer to rsg(1). In which manual did you see that was
possible. If it was possible, it would have been in the pl/sql
reference manual.


--
Sybrand Bakker, Senior Oracle DBA
