I'm writing a shell script to spool multiple columns in PL/SQL table to CSV. But all the columns are added to a single column in the CSV file. Can't seem to figure out what the problem is.
FILE="x26837a/test.csv"i
sqlplus -s MyConnection << EOF
set heading on;
set pagesize 1000;
set tab on;
column owner format a10;
column parent_object_name format a20;
column sub_object_name format a30;
column object_type format a40;
column invalid_abbr format a50;
column email_flag format 9999999;
set linesize 300;
SPOOL $FILE;
SELECT * FROM NM_STD_TBL WHERE ROWNUM < 10;
SPOOL OFF;
EXIT;
EOF