I am writing a script file for SQL*PLUS which spools output to a file but I noticed it does not include the headers, even when I set the HEADING on:
Running this script, for example, results in this log file:
Code:
-- set output to a file
SPOOL RCPI_RUN_ALL.LOG
SET ECHO ON
SET LINESIZE 500
SET PAGESIZE 0
SET SERVEROUTPUT ON SIZE 1000000
SET SCAN OFF
SET FEEDBACK ON
SET TERMOUT ON
SET TAB OFF
SET HEADING on
-- ============================================================
-- Verify that this script is running in the right instance
-- ============================================================
SELECT * FROM whoami;
Running this script, for example, results in this log file:
However, when I run it within SQL*PLUS, I get the following:SQL> SET LINESIZE 500
SQL> SET PAGESIZE 0
SQL> SET SERVEROUTPUT ON SIZE 1000000
SQL> SET SCAN OFF
SQL> SET FEEDBACK ON
SQL> SET TERMOUT ON
SQL> SET TAB OFF
SQL> SET HEADING on
SQL>
SQL> -- ============================================================
SQL> -- Verify that this script is running in the right instance
SQL> -- ============================================================
SQL> SELECT * FROM whoami;
DEV6 RCPI 09-12-2008 13:32:35
1 row selected.
Does anyone see why it does not appear this way in my spooled file?SQL> SELECT * FROM whoami;
INSTANCE LOGGED_ON_AS DATE_TIME
---------------- --------------- -------------------
DEV6 RCPI 09-12-2008 13:34:04