How do I turn off output to terminal sqlplus from a select statement when I
am spooling the result to a text file ?
I have tried echo off, feedback off etc. but nothing seems to work.
The problem is not easy to handle when the result is huge and I am
over a modem connection.
Thanks.
Atif Khan
aa...@ra.msstate.edu
Best regards
Bosse Melin, Sweden
bosse...@gislaved.mail.telia.com
Atif Ahmad Khan <aa...@Ra.MsState.Edu> skrev i inlägg
<aak2.85...@Isis.MsState.Edu>...
However, if you are in a UNIX environment you can redirect the output to
the null device while you spool to a file. This will avoid collecting
massive amounts of data in log files etc.
Good luck.
Alex Jentilucci - Consultant
Information System Dynamics, Inc
Minneapolis, MN 55323
Tele: 612-476-7395 FAX: 612-473-5954 E-Mail: inf...@aol.com
E-Mail Work: jenti...@notes.seagate.com
Home: Alex...@aol.com
I make file d:\temp\test.sql as
set echo off
set termout off
spool d:\temp\test.txt
select * from dict;
spool off
set termout on
set echo on
and then I ran it from sqlplus like
SQL> @d:\temp\test.sql
and "termout off" don't stop spooling result to file.
(Windows NT platform and SqlPlus 3.3)
Best regards Jorma
Actually, that is not correct. You can SET TERMOUT OFF and still spool
the output to a file.
Dave
Not my understanding.
set termout off
spool spoolfile.lst
select * ...
spool off
and your spool file contains the select data.
janet
>How do I turn off output to terminal sqlplus from a select statement when I
>am spooling the result to a text file ?
>I have tried echo off, feedback off etc. but nothing seems to work.
>The problem is not easy to handle when the result is huge and I am
>over a modem connection.
Have you tried " set flush off" ?
rgrds Kari
Use set termout off
IE: sqlplus -s username/password @yourscript.sql > spooldata.txt
Actually with this method, you should not have a "spool" statement in your
script.
If you are not on a unix platform....I'll be looking at responces you
receive....
The option to use is: set termout off
There are some restrictions, though. 'set termout off' will only work
if you are running an external SQL script (eg, start sqlscript.sql). It
does not work for an interactive query from the keyboard.
Furthermore, if you are using UNIX and the SQL is in an in-line redirect
(aka, a here document), then 'set termout off' will not work either
because SQL*Plus still thinks it is interactive input. The following is
a simple example of such a case:
sqlplus -s username/password << endOfSQL
set termout off
select * from emp;
endOfSQL
In the above UNIX script, the 'set termout off' will NOT stop output to
standard output. This is because UNIX passes the 'SQL script' to
SQL*Plus as if it were interactively input through the keyboard. One
way I have used to get around this is to pipe the output of the
SQL*Plus, such as:
sqlplus -s username/password << endOfSQL | grep -E "^ORA-|^ERROR"
select * from emp;
endOfSQL
In the above example, your terminal would only show you Oracle error
lines. Other variants are obviously possible according to your needs.
Hope this helps.
=================================================
Jerry Apfelbaum email: japf...@ican.ca
Eastern Sun Group Inc. phone: 416.769.8738
Toronto, Canada fax: 416.769.7428
Regards,
Kevin
> Regards,
> Kevin
or when invoking sqlplus with input coming from a script 'sqlplus -s'
regards,
Mark Killick
Keith