Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL*Plus results without additional information

Re: SQL*Plus results without additional information

From: il pazzo <ilpazzo_at_internazionale.it>
Date: Thu, 09 Sep 2004 10:11:40 GMT
Message-ID: <w%V%c.2207$6b4.59152@twister1.libero.it>


use

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

or

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

instead of

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

"Ralf Zwanziger" <ralf_on_duty_at_gmx.de> ha scritto nel messaggio news:0120k0lebd1qlvk4gs035gfrdgoud19fmm_at_4ax.com...
> 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 - 05:11:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US