Home » Other » Client Tools » Hide SQL > statements in the spool file (11g)
Hide SQL > statements in the spool file [message #638792] Sun, 21 June 2015 09:54 Go to next message
kiranrathodkr916
Messages: 36
Registered: March 2014
Location: India
Member

I want to hide the "SQL> @test.sql" and "SQL> spool off" in the file test.txt(spool file)

my steps

set heading off 
set pages 0 
set trimspool on 
set lines 120 
set feedback off 
set echo off 
set termout off 
spool test.txt
@test.sql
spool off
test.txt

SQL> @test.sql                              
2002452199  2797    9/1/2014    9/30/2014   OO56128665          934 90087318    1   6046
10226342            ##########  0   0                   


SQL> spool off
Re: Hide SQL > statements in the spool file [message #638793 is a reply to message #638792] Sun, 21 June 2015 12:20 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Put the "spool" statement inside the script.

Re: Hide SQL > statements in the spool file [message #638795 is a reply to message #638793] Sun, 21 June 2015 12:36 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
SQL> !cat test.sql
set heading off 
set pages 0 
set trimspool on 
set lines 120 
set feedback off 
set echo off 
set termout off 
spool test.txt
select sysdate from dual;
spool off
exit

SQL> @test.sql
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost dbs]$ cat test.txt
21-JUN-15
[oracle@localhost dbs]$ 
Re: Hide SQL > statements in the spool file [message #638836 is a reply to message #638795] Mon, 22 June 2015 15:15 Go to previous messageGo to next message
kiranrathodkr916
Messages: 36
Registered: March 2014
Location: India
Member
thank you
Re: Hide SQL > statements in the spool file [message #647436 is a reply to message #638836] Wed, 27 January 2016 14:33 Go to previous messageGo to next message
milind2mb
Messages: 2
Registered: January 2016
Location: Indiana, US
Junior Member
use silent -s option and redirect output to some file.

sqlplus -s user/pass > out.log

[Updated on: Wed, 27 January 2016 14:33]

Report message to a moderator

Re: Hide SQL > statements in the spool file [message #647437 is a reply to message #647436] Wed, 27 January 2016 14:37 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Nope, the correct answer has already be given.

Previous Topic: To Run Sql script in background
Next Topic: Error to Associate Migration Repository
Goto Forum:
  


Current Time: Thu Mar 28 06:23:50 CDT 2024