Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Returning data from temp_tables

Re: Returning data from temp_tables

From: BGT <bgt0990_at_optonline.net>
Date: Mon, 06 Aug 2007 04:48:41 -0700
Message-ID: <1186400921.398124.269610@k79g2000hse.googlegroups.com>


Actually it's not that simple. That was my first approach. I cannot define the cursor with a dynamic SQL bind variable, I get an error; The cursor I'm trying to pass back is dependent on the results of a previous cursor loop.

create or replace procedure foo(bar OUT sys_refcursor) is

sqlstring := 'select empno from emp' where emp.empno = :1 c1rec emp.empno%type;

begin

open C1 for select empno from emp;
  LOOP
    FETCH c1 INTO c1rec;
   EXIT WHEN C1%NOTFOUND; open bar for sqlstring

   Using c1rec;
 Loop
   Fetch bar into ???
 exit when bar%NOTFOUND;
 End LOOP;
 END LOOP;
Close C1;

end; Received on Mon Aug 06 2007 - 06:48:41 CDT

Original text of this message

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