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 convert the varray to ref cursor

902424Nov 28 2011 — edited Nov 28 2011
Hi,

Is there any way to convert varray to ref cursor....
i dont want to use any table or record as an ref cursor..

i just want to create a procedure which returns a ref cursor..

below is the sample procedure for it..

---------------------------------------------------------------------------------------------------
create or replace procedure FETCH_DATA1
(
tab_name in varchar2,
p_recordset1 OUT fetch_data_pak.ref_cursor
)
AS
type v_array1 is varray(1000) of t_transaction%rowtype;
v_array2 v_array1;
cursor s1 is select * from t_transaction where lastupdate_date > '08-Aug-09';
begin
open s1;
fetch s1 bulk collect into v_array2 limit 100;
close s1;
select * from table(cast (v_array2 as p_recordset1));
end FETCH_DATA1;

---------------------------------------------------------------------------------------------------

I need to convert the varray to ref cursor.....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2011
Added on Nov 28 2011
2 comments
373 views