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 use SYS_REFCURSOR as a table in calling sp

729927Dec 1 2009 — edited Dec 1 2009
hi gurus,

here i have 2 sp in which i m calling GET_OPREF inside GET_REFCALL. and in GET_REFCAL i want to use output cursou as a table .
plz help me ....
CREATE OR REPLACE PROCEDURE GET_OPREF
(p_cursor OUT  SYS_REFCURSOR )
is
begin
 open p_cursor FOR
    select 10 amt from dual union all
    select  20 amt from dual union all
    select 30 amt from dual ;

end GET_OPREF ;

 
CREATE OR REPLACE PROCEDURE GET_REFCALL
is
  c_cursor   SYS_REFCURSOR ;
  r_emp      get_2%rowtype ;
  
   v_tot int ;
begin  
  GET_OPREF(c_Cursor);
select sum (amt) into v_tot from c_Cursor;  -- *here i want to user cursor as a table* 
    dbms_output.put_line(v_tot );  
end get_refcall ;
Edited by: user12108669 on Dec 1, 2009 5:03 AM

Edited by: user12108669 on Dec 1, 2009 5:09 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 29 2009
Added on Dec 1 2009
9 comments
3,414 views