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: Use returned cursor in another PL/SQL proc

Re: Use returned cursor in another PL/SQL proc

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 05 Jan 2006 09:37:51 -0800
Message-ID: <1136482669.270435@jetspin.drizzle.com>


roberto galbiati wrote:
> hi all
>
> i have a procedure like this (in package CORP_REPORT):
>
> PROCEDURE Confronto
> ( IN_IDREQUEST IN NUMBER,
> CUR_1 IN OUT CORP_REPORT.TCUR_1
> )
> IS
> BEGIN
> ... do something ...
> OPEN CUR_1 FOR
> SELECT * from table1, table2, tableEtc..
> where <something specific> ;
>
> END;
>
> it works perfectly with ORACLE.NET data provider, ADO, Crystal, etc...
>
> But I need in some case to process that data again in PL/SQL, something
> like:
>
> PROCEDURE NewConfronto
> ( IN_IDREQUEST IN NUMBER,
> CUR_1 IN OUT CORP_REPORT.TCUR_1
> )
> IS
> InternalTCUR CORP_REPORT.TCUR_1;
> BEGIN
>
> EXEC Confronto(IN_IDREQUEST,InternalCUR);
>
> OPEN CUR_1 FOR
> SELECT x,y,z
> from InternalCUR
> where <..other conditions...>;
> END;
>
> How can this be done?
> On the Web everyone explain how to use returned cursor OUT OF ORACLE,
> but not in...
>
> Thanks
> Roberto

The code sample you have provided is NOT real code leading to many questions. But basically you should be using a REF CURSOR and you can find an example that does what you seem to be trying to do if you go to www.psoug.org. Click on Morgan's Library and look at the REF CURSOR demos.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Thu Jan 05 2006 - 11:37:51 CST

Original text of this message

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