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;