I have a stored proc Procedure1,
- Within Procedure1, I am calling another procedure Procedure2 which returns sys_refcursor ProcResult2.
- I need to traverse through each row of this cursor and insert the data into a table
The code
Create Procedure1()
as
ProcResult1 Sys_refcursor;
begin
Procedure2(ProcResult2);
For eachrow in ProcResult2
Loop
insert into test_table(ProcResult2.Id);
end loop;
end ;\
Any idea, pointers on how to achieve the 2. functionality ? That is traverse through each row returned in ProcResult2 and insert into a new table.