This content has been marked as final. Show 6 replies
For sqlplus set echo off turns off the statement echo, but only when the sql is run from a file (@<file> or start <file>).1 person found this helpful
For SQLs at the SQL> prompt, you'll still get the statement in the spool file :(
So you are saying if I run the query at the sql prompt as from file, it might work? I will try that.
However, I doubt what you are saying is correct, some one somewhere would've mentioned it? But I have no knowledge on this. Just a guess.
I appreciate your response. This thing is driving me nuts. It is so simple and we can generate text files left and right all day long in mssql server. Too bad I couldn't find a comparatively simple solution in Oracle. :(
In the 10g sqlplus user guide ... http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm#sthref2745
This is getting very frustrating. Below is what I type in my sql plus window.
set colsep ','
set echo off
set feedback off
set linesize 1000
set pagesize 0
set sqlprompt ''
set trimspool on
set headsep off
This creates the output file, where first line is @"FILEWITHQUERY.SQL"
then shows the result set rows, the last row in the file is "spool off"
Can you please show me an example that works for you? I never imagined generating a text file from tables is this hard. :((
Try putting the spool commands in the FILEWITHQUERY.SQL and if you add a `set termout off` you won't even see the results.
Thank you so much. That worked. I guess putting all the 'set's along with the query in one file sort of puts them all in one 'scope'.
It works perfectly now.