spool output to .csv file - having issues with data display
883189May 1 2013 — edited May 2 2013Hi,
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;