sql script "set heading ON" doesn't work
This question might be silly, but it would be great if someone can help me out.
I want to spool a table to a file with the column heading on, so I wrote a sql script like
set heading ON
set pagesize 0
set termout off
spool XXXX
select column1 || ','|| column2 ||','|| ... from table
/
spool off
However, when I run this script, the spooled file is always with no column headings. The sql plus session's environment has the default heading on. I have no idea what might go wrong? Could this be solved if I restat the database server? Because I run this on both the db server and workstations, I got the same result.
Thanks in advance.