Passing out parameters through ORACLE Procedures

Greetings,
I have three stored procedures in ORACLE

 
--PARENT PROCEDURE
procedure TRANSCRIPT REPORT (pBSA in NUMBER, FRM_ID in NUMBER, TRANSCRIPT_CURSOR in OUT TRANSCRIPTS.TRANSCRIPTSOUTPUT)

CASE WHEN FRM_ID=1 THEN EXECUTE SAR_TRANSCRIPT(BSA, #TRANSCRIPT_CURSOR) END
CASE WHEN FRM_ID=2 THEN EXECUTE RMSB_TRANSCRIPT(BSA, #TRANSCRIPT_CURSOR) END

END PROCEDURE

--SAR_TRANSCRIPT
procedure SAR_TRANSCRIPT (pBSA in NUMBER, TRANSCRIPT_CURSOR in OUT TRANSCRIPTS.TRANSCRIPTSOUTPUT)

   open TRANSCRIPT_CURSOR for --need to uncomment this for SP
        select (...) FROM (...);

END PROCEDURE

--RMSB_TRANSCRIPT
procedure RMSB_TRANSCRIPT (pBSA in NUMBER, TRANSCRIPT_CURSOR in OUT TRANSCRIPTS.TRANSCRIPTSOUTPUT)

   open TRANSCRIPT_CURSOR for --need to uncomment this for SP
        select (...) FROM (...);

END PROCEDURE

Open in new window


I need to call one of the sub-procedures from the parent procedure, and then take the ref_cursor output of the sub-procedure and make that the output of the parent procedure.

Assume the ref_curser is called TRANSCRIPTS.TRANSCRIPTSOUTPUT

Thanks
LVL 9
Evan CutlerVolunteer Chief Information OfficerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
What problems are you having?

I'm not following your code stubs but below is a test case that shows what I think you want (tested using sqlplus).
create or replace procedure child(outCur in out sys_refcursor)
is
begin
	open outCur for 'select sysdate from dual';
end;
/

show errors

create or replace procedure parent(outCur in out sys_refcursor)
is
begin
	child(outCur);
end;
/

show errors

var cur1 refcursor
exec parent(:cur1);

print cur1

Open in new window

0
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
Ok,
how do you put child(outCur) into the parent procedures outCur out variable?
0
slightwv (䄆 Netminder) Commented:
It does it automatically with the 'in out' declaration.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
AWESOME...
Thanks much my friend...

See you around the EE.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.