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