SQL*Plus results without additional information

From: Ralf Zwanziger <ralf_on_duty_at_gmx.de>
Date: Thu, 09 Sep 2004 09:46:12 +0200
Message-ID: <0120k0lebd1qlvk4gs035gfrdgoud19fmm_at_4ax.com>



[Quoted] I'm trying to spool a select result into a file on unix. To do that, I have a shell script with the following line:

...

sqlplus scott/tiger_at_database < create.sql > /dev/null
...

and an additional file "create.sql" with the following commands:

set pagesize 0
set linesize 200
set serveroutput off
set heading off

spool MyResults
SELECT Data FROM OutputTable;
spool off

This works, but my "MyResults"-File does not only contain the selected rows. First line of output is "SQL> " followed by the select statement.
And the file ends with a blank line, a line saying "87 rows selected", another blank line and a line containing "SQL> spool off".

Is it possible to avoid the additional four lines at the end of my result and the first line with the sql command? Of course I could do some "grep -v" in my shell script after the MyResults is created, but I think there must be a better way, to avoid the "garbage lines" when doing the select.

Greetings,
Ralf Received on Thu Sep 09 2004 - 09:46:12 CEST

Original text of this message