Unanswered: Spool file without select statements appearing?
I need to spool output. However, I do not want the query to appear in the output.
Ok... So I am burned out a little. I have pages and pages worth of a query that's ready to go except.... I have a question about spooling. I am using SQL*Plus through Oracle 8 client... The server has Oracle 10g.
Now, the result appears even after I set feed off, set term off, set ver off, set echo off, etc.... I receive a few rows. Good - I want the output. However, I do not want the SQL. The select statements appear in the output as well. I don't want others to see the select statements if they are running it. I just want them to see the output - the few rows that the query produced.
What am I missing? Is there anything that can be done?
You were close to the solution - SET ECHO OFF might help you. There are two ways to use it: first one is using it directly at the SQL*Plus prompt (which will NOT do what you want), and the other one - helpful one - is running the whole thing from the .SQL script.
Therefore, if you create a script file (let's call it "example.sql"), such as
SET ECHO OFF;
SELECT * FROM dept;
and run it as
you'll get desired output in the "example.txt" file and it will not have the SELECT statement listed in it.
There might be another solution, but I don't know it ...