| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> SQL*Plus results without additional information
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 - 02:46:12 CDT
![]() |
![]() |