I am trying to spool large datasets (200k+ row) to csv format and need the columns not to be quoted. This is possible via the export settings of the SQL Developer GUI, but I am trying to do this via a SQL script. The resulting csv file is then read by another application. To demonstrate this I run the below script.
set ECHO off set FEEDBACK off set LINESIZE 60 set RECSEP off set TRIMSPOOL on set VERIFY off set PAGESIZE 0 set SQLFORMAT csv spool y:\aa.csv SELECT * FROM PRODUCT_COMPONENT_VERSION; spool off
This gives the ouput
"PRODUCT","VERSION","STATUS" "NLSRTL ","18.104.22.168.0","Production" "Oracle Database 11g Enterprise Edition ","22.214.171.124.0","64bit Production" "PL/SQL ","126.96.36.199.0","Production" "TNS for Linux: ","188.8.131.52.0","Production"
I need the output as below (NO QUOTED STRINGS)
PRODUCT,VERSION,STATUS NLSRTL ,184.108.40.206.0,Production Oracle Database 11g Enterprise Edition ,220.127.116.11.0,64bit Production PL/SQL ,18.104.22.168.0,Production TNS for Linux: ,22.214.171.124.0,Production
I would rather not post-process the file (powershell, perl, etc) after generation and before loading as it just adds unnecessary steps to a process.
How can I do a spool file where I can specify the left and right enclosures even setting them to NULL.