Re: How to make use of the data in a cursor returned from a stored procedure?
Date: Wed, 31 Jul 2002 20:55:20 GMT
Message-ID: <3D484EB7.4CBE61A3_at_exesolutions.com>
wing wrote:
> Hi,
>
> I am new to oracle stored procedure.
>
> I have written a stored procedure which returns a cursor. I am trying
> to write a corresponding test program to verify the cursor output.
>
> The stored procedure is
> PackClientCashLedger.GetCashLedgerRecord(ioSeverity, ioErrorMsg, cur,
> '0001');
> which cur is the returned cursor with firm_id as one of the field.
>
> The testing program is as follows,
>
> declare
> cur types.cursortype;
> c varchar2(4000);
> ioSeverity varchar2(20);
> ioErrorMsg varchar2(20);
>
> begin
> dbms_output.enable(1000000);
> PackClientCashLedger.GetCashLedgerRecord(ioSeverity, ioErrorMsg,
> cur, '0001');
> for cur_rec in cur
> loop
> dbms_ouput.put_line(cur_rec.firm_id);
> end loop;
> end;
> /
>
> which returns the error when ran,
> ERROR at line 13:
> ORA-06550: line 13, column 17:
> PLS-00221: 'CUR' is not a procedure or is undefined
> ORA-06550: line 13, column 2:
> PL/SQL: Statement ignored
>
> Thanks in advance for any input,
>
> Wing
I think you need to look at the documentation rather than just guessing.
I think what you are trying to define is called a REF CURSOR.
Daniel Morgan Received on Wed Jul 31 2002 - 22:55:20 CEST