PL/SQL (MOSC)

MOSC Banner

Can we fetch a cursor data into ref cursor variable??

edited Dec 17, 2012 2:05AM in PL/SQL (MOSC) 1 commentAnswered ✓
 Hi,
can any body please provide me a example or make sure that can we  fetch a cursor into ref cursor data type variable??

but here it is working

declare
cursor c is select  d.deptno,cursor( select * from emp  e where e.deptno=d.deptno) emp_all from dept d;
v_deptno number;
v_all sys_refcursor;
v_a emp%rowtype;
begin
open c;
loop
fetch c into v_deptno,v_all;
exit when c%notfound;
dbms_output.put_line(v_deptno);
loop
fetch v_all into v_a;
exit when v_all%notfound;
dbms_output.put_line(v_a.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center