Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to call a function which returns refcursor from another function

Sa SiApr 12 2018 — edited Apr 13 2018

i want to call function A which returns refcursor from another function B. how can i do it ?

create package p1

as

function A(p_empno number) return sys_refcursor;

function B return sys_refcursor;

end;

create package body p1

as

function A(p_empno number) return sys_refcursor

is

c1 sys_refcursor;

begin

open c1 for select ename,empno,deptno from emp where empno = p_empno;

return c1;

end;

function B return sys_refcursor

is

c2 sys_refcursor;

begin

open c2 for select p1.A(10) from dual;

return c2;

end;

end;

now call the function B using a select

This post has been answered by John Thorton on Apr 12 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 11 2018
Added on Apr 12 2018
3 comments
1,161 views