I have two tables one DEPT and employee tables. I am trying to return resultset (using ref cursor) like
for every 1 row of dept the corresponding employeess
for eg for dept "SALES"
select * from Dept where type = "sales"
select * from employess where type = "sales"
for that i declare a package with ref cursor
and procedure is as follows
procedure LoadDeptEmployess ( generic_cursor in out instr_ref_cursor )
cursor deptCk is select deptId from Dept;
/* so far each row in dept fetch all the employees */
for dept_rec in deptCk Loop
open generic_cursor for select * from Dept
where deptd = dept_rec.deptId;
when i tried to execute it i am only seeing the last rows in dept table. i don't know why?
if anybody knows the answer or suggestion to get all the rows will be really helpful.