Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Use returned cursor in another PL/SQL proc
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
![]() |
![]() |