Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Returning data from temp_tables
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
![]() |
![]() |