Home » SQL & PL/SQL » SQL & PL/SQL » appending to a result cursor? possible?
appending to a result cursor? possible? [message #37635] Mon, 18 February 2002 07:29 Go to next message
Ed Barron
Messages: 1
Registered: February 2002
Junior Member
I have a slightly complicated query where I'd like to progressively build a cusorResult from several iterative queries. Below is what I'd like to accomplish, though
the syntax is not valid. (You cannot embed a for in an open cursor result for) Can someone point me in the right
directions?

Thanks,
-Ed.
    open cursorResult for
      for job_rcd in deptids(emplidArg, startDateArg, endDateArg) LOOP
        for curr_date in tree_dates(job_rcd.effdt,
				    endDateArg,
				    job_rcd.deptid) LOOP
          SELECT *
  	    FROM pstreenode
	    WHERE tree_name = 'DEPT_SECURITY' and effdt = curr_date.effdt
	    START WITH
	      tree_node = deptidArg and tree_name = 'DEPT_SECURITY' and
	      effdt = curr_date.effdt
	    CONNECT BY
	      PRIOR parent_node_num = tree_node_num and
	      tree_name = 'DEPT_SECURITY' and effdt = curr_date.effdt;
        end loop;
      end loop;
    return cursorResult;
Re: appending to a result cursor? possible? [message #37636 is a reply to message #37635] Mon, 18 February 2002 08:19 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
create global temoprary table ,populate that table inside procedure and open cursor against that table
Previous Topic: Setting up and connecting HELP
Next Topic: Stored Procedure Tuning.
Goto Forum:
  


Current Time: Thu Mar 28 11:41:42 CDT 2024