Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Nested cursors in a function
I need to return a cursor from a function based on nested select
statements:
CURSOR pre_cur IS
SELECT
...
CURSOR main_cur(myDate DATE, myId INTEGER, myOrganization VARCHAR2) IS
SELECT
...
WHERE ... = myDate AND ... = myId AND ... = myOrganization
How do I go through the first cursor and execute/open the second cursor
with parameters from the first cursor and then return the result
(multiple rows)
from the function?
This is what I have been trying to do (without success):
FOR temp_rec IN pre_cur
LOOP
OPEN main_cur(temp_rec.myDate, temp_rec.myId,
temp_rec.myOrganization);
END LOOP;
RETURN main_cur;
Thanks
Mathias
Received on Fri Aug 21 1998 - 07:49:48 CDT
![]() |
![]() |