Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set echo off

Status
Not open for further replies.

mgl70

Programmer
Sep 10, 2003
105
US
Hi,
I have a question. I donot want to see the sqlquery in my report. for that I gave set echo off. but still it is giving my sql query with results. how to set that.

ex:
set echo off;
set verify off;
set feedback off;
spool test.txt
select * from emp;
spool off;

It is showing sql query in my spool file.
I checked like this. show echo. it is showing echo off. but I donot know why it is showing. help please.
Thanks in advance.
 
MGL,

"set echo off" works only if it appears in a script and you execute the script. (Oracle should have labeled the command, "set echoscriptcode off".[smile]) If you issue the "set echo off" command from the SQL> prompt along with the rest of your code, all of the code appears on the screen, thus to your spool file.

So, my question for you is, "Did you execute all of the above code from within a script that you invoke via 'SQL> @<script_name>'?"

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
If I execute as a script file, file is creating but empty.
SQL>@test.sql
Thanks.
 
How many rows should the query return? Have you confirmed that it returns to the screen the rows that it should? Not that it should need it (thanks to the "spool off"), but following the script execution, exit SQL*Plus to an o/s prompt (just to see if that makes a difference to your "test.txt" file contents).

Let us know if any of this is successful.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
It is working since I forgot to put semicolon at the end of the line for spool command in the script file. Thanks Mufasa.
 
Actually, MGL, a missing/present semicolon was not your problem: "SPOOL" is a SQL*Plus command; as such, semicolons are extraneous (neither hurting nor helping the command). So, if it is working now, something else is attributable to your success.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top