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!

spool output to .csv file - having issues with data display

883189May 1 2013 — edited May 2 2013
Hi,

Need to deliver the output of a select query which has around 80000 records to a .csv file. A procedure is written for the select query and the procedure is being called in the spool script. But few of the columns have comma(,) in the values. For Example, there is a personal_name column in the select query which says the name as " James, Ed". Then output is displayed in different columns. Hence the data is being shifted to the right for the remaining columns.
Could some one help fix this issue. I mainly used a procedure as the select query is about three pages and hence want the script to look clear.

Script is,

set AUTOPRINT ON ;
set heading ON;
set TRIMSPOOL ON ;
set colsep ',' ;
set linesize 1000 ;
set PAGESIZE 80000 ;
variable main_cursor refcursor;
set escape /
spool C:\documents\querys\personal_info.csv
EXEC proc_personal_info(:main_cursor);
spool off;
This post has been answered by AlbertoFaenza on May 2 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 30 2013
Added on May 1 2013
11 comments
25,912 views