If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

suppress display

Hello, Can somebody please tell how to suppress the query result in sql*plus? I need something to work like unix re-direction operator. i.e I want to issue a select statement and send the results (rows) to a file. They should NOT be displayed on screen. I am using spool to do so, but need help with suppressing the results.

I used the following
set verify off
set heading off
set linesize 6000
set feedback off
set termout off
set term off
spool out1.txt

I used sqlplus -s option. It suppressed the screen display but not the query result. The records displayed as usual. Is there anything else that I should add to the above? Thanks again.

From the doc:
SET TERM[OUT] {ON|OFF}
Controls the display of output generated by commands executed from a script. OFF suppresses the display so that you can spool output from a script without seeing the output on the screen. ON displays the output. TERMOUT OFF does not affect output from commands you enter interactively.

set verify off;
set term off; //also with set termout off tried both seperately
set linesize 6000;
set feedback off;
set pagesize 0;
set echo off;
set sqlprompt '';
set trimspool on;
set termout off;
spool out_C1.txt

It STILL displays the rows ... I don't want sql*plus scroll 1/2 million records. Basically, I want to spool the records to a text file ... Is this the right way?

Sorry, that was a browser problem ... I tried Marist's script and it worked well. Mr.Hanky your script seems to be the same. Thanks for the tip. BUT, please note that if I type the commands on plain sql*plus window and spool, it still displays output. I don't know why TERMOUT is not working here.