I am using oracle PL/SQL procedure. I am calling one procedure inside another. I want to return a cursor from the nested procedure to the outer procedure. Is this possible? How adversely does it affect the procedure?
Below is the calling structure:
Proc1( data1 IN integer, cursor1 OUT SYS_REFCURSOR ) {
Proc2(data2 IN , cursor1 out) {
open cursor1 FOR
select * from table;
}
}
Here is one example of calling procedures that have REF CURSOR OUT parameters.
In this case, I'm creating a SQL*Plus substitution variable rc in order to demonstrate how to call p2. If you are calling it in something other than SQL*Plus, the syntax will be a bit different but the general principle will be the same.