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!

Cursor to CSV

899582Nov 11 2011 — edited Nov 14 2011
I have a select query (or a cursor) that i want to use and generate a excel file.
i defined as a ref cursor
pio_cstdn_extract_cur IN OUT custodian_cursor_type) IS


select script at v_chr_sql is working but at fetch (fetch pio_cstdn_extract_cur bulk collect into l_c1, l_c2, l_c3 limit l_limit;) I get Exception

OPEN pio_cstdn_extract_cur FOR v_chr_sql;
loop
fetch pio_cstdn_extract_cur bulk collect into l_c1, l_c2, l_c3 limit l_limit;
for i in 1 .. l_c1.count
loop
dbms_output.put_line( l_c1(i) || ',' || l_c2(i) || ',' || l_c3(i) );
end loop;
exit when pio_cstdn_extract_cur%notfound;
end loop;
close pio_cstdn_extract_cur;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 12 2011
Added on Nov 11 2011
8 comments
1,103 views