CSV File output from Refcursor
899582Nov 14 2011 — edited Nov 16 2011I have to set a Cron job to run the package/procedure on a daily basis.
Within the procedure , I have a ref cursor and i need to convert the data into a CSV or excel file . This proc will be called in a cron job and the output file will be placed in some folder within server or networl Drive , Please help
I have used Tom's dump_csv function and facing some exceptions here.
_______________________________________
I decleared the varicable in my Procedure
v_location varchar2 1000):='/data/cmst/cms/data/pricing' ;
v_file_name varchar2(1000):='Extract_Details.txt' ;
l_c1 sys.odciVarchar2List;
l_c2 sys.odciVarchar2List;
l_c3 sys.odciVarchar2List;
l_limit number := 10;
_______________________________________
Refcurdor defined as
TYPE custodian_cursor_type IS REF CURSOR;
_______________________________________
and now i am calling the function like this
OPEN pio_cstdn_extract_cur FOR v_chr_sql;
loop
fetch p_cur bulk collect into l_c1, l_c2, l_c3 limit l_limit;
close pio_cstdn_extract_cur;
--dump_csv( v_chr_sql,',',v_location,v_file_name);
Dump_CSV takes p_query as input but i have a ref cursor with me , i am new to the ref cursor and
utl_file concepts , I may be worng in writing the code above , Please guide
___________________________________________
Thanks in advance.