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 -> Nested cursors in a function

Nested cursors in a function

From: Mathias Nilsson <mathias.nilsson_at_NOSPAMeng.ericsson.se>
Date: Fri, 21 Aug 1998 14:49:48 +0200
Message-ID: <35DD6CEC.3CC8B787@NOSPAMeng.ericsson.se>


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

Original text of this message

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