This is my bat script:
set linesize 4000 pagesize 0 colsep ','
set heading off feedback off verify off trimspool on trimout on
spool &1
select *
from siebel.s_contact;
spool off
exit;
Then I try to run below command. I can generate a Excel
file with data but column names are missing.
C:\Users\jy70606\Documents\Script>sqlplus -s geneos/password@database @C:\Users\jy
70606\Documents\Script\daily.sql daily.csv
My question is, how to make the columns available in my Excel
?
Your Bat Script contains the following command to remove the columns
set heading off
You need to switch it on
set heading on
Reference: https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12040.htm#i2699001