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.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Spool file without select statements appearing?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-01-05, 16:09
sfoster sfoster is offline
Registered User
 
Join Date: Jul 2004
Posts: 13
Spool file without select statements appearing?

Hi all,

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?

Thanks,
SFoster
Reply With Quote
  #2 (permalink)  
Old 11-02-05, 02:13
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
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;
SPOOL example.txt
SELECT * FROM dept;
SPOOL OFF;

and run it as

SQL> @example.sql

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 ...
Reply With Quote
  #3 (permalink)  
Old 11-02-05, 11:12
sfoster sfoster is offline
Registered User
 
Join Date: Jul 2004
Posts: 13
Thank you!

Thank you for your help.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On