Home » SQL & PL/SQL » SQL & PL/SQL » Spool
Spool [message #353871] Wed, 15 October 2008 07:22 Go to next message
ora_2007
Messages: 430
Registered: July 2007
Location: Mumbai
Senior Member
Hi,
I am sppoling file into text1.txt.

But at the same time i can see the output on the prompt.

I dont want to show that output. I want to save it directly.

Please tell me which option i nedd to use.

Thanks.
Re: Spool [message #353872 is a reply to message #353871] Wed, 15 October 2008 07:26 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
set termout off

Regards
Michel
Re: Spool [message #353874 is a reply to message #353871] Wed, 15 October 2008 07:31 Go to previous messageGo to next message
ora_2007
Messages: 430
Registered: July 2007
Location: Mumbai
Senior Member
sqlplus -s sys/*** as sysdba <<EOF

set time on
set timing on

set feedback off
set echo on
set linesize 5000
set pages 1000
set pagesize 1000
set termout off
COLUMN          ID              FORMAT          9999999999              heading         "ID"
COLUMN          DATABASE_ID     FORMAT          9999999999              heading         "DATABASE_ID"
COLUMN          LEADNO          FORMAT          a15             heading         "LEADNO"
COLUMN          FIRSTNAME       FORMAT          a100            heading         "FIRSTNAME"
COLUMN          LASTNAME        FORMAT          a100            heading         "LASTNAME"

set termout off
spool export.log append

select ID, DATABASE_ID, LEADNO, FIRSTNAME, LASTNAME
from TEST where database_id=1 and rownum<100;

exit;
EOF




Still showing output on the screen.

Please guide.
Re: Spool [message #353876 is a reply to message #353874] Wed, 15 October 2008 07:42 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
You have to do a
start foo.sql

or
@foo.sql
Re: Spool [message #353879 is a reply to message #353871] Wed, 15 October 2008 07:50 Go to previous message
ora_2007
Messages: 430
Registered: July 2007
Location: Mumbai
Senior Member
Thanks,

It works
Previous Topic: How to remove the duplicate rows
Next Topic: how to achieve Anti pivoting in 10g
Goto Forum:
  


Current Time: Sun Dec 04 02:30:21 CST 2016

Total time taken to generate the page: 0.04611 seconds