Home » RDBMS Server » Server Administration » Export the result of a query to text file
Export the result of a query to text file [message #374073] Wed, 23 May 2001 20:45 Go to next message
jeanette
Messages: 1
Registered: May 2001
Junior Member
HI;
I need to run SQL (projection and selection type queries) and save the results to a tab (or comma)delimited text file, is there a way to do this other than use spool as my text editor progams don't like opening 40+Mb files just so I can remove the first few lines.
Re: Export the result of a query to text file [message #374074 is a reply to message #374073] Wed, 23 May 2001 21:37 Go to previous messageGo to next message
Sarada
Messages: 27
Registered: April 2001
Junior Member
Hi,

To my knowledge spool is the only way from SQLPLUS to export to text files. You could set the environment like
SET FEEDBACK OFF
SET ECHO OFF
SET PAGES 0
Still, you may need to remove atleast 2 lines from the created flat files. Otherwise you should opt for 3rd party tools like Toad.
Visit www.quest.com - for a free download

HTH

Orashark
Re: Export the result of a query to text file [message #374075 is a reply to message #374073] Wed, 23 May 2001 21:42 Go to previous messageGo to next message
Sarada
Messages: 27
Registered: April 2001
Junior Member
Hi,

To my knowledge spool is the only way from SQLPLUS to export to text files. You could set the environment like
SET FEEDBACK OFF
SET ECHO OFF
SET PAGES 0
Still, you may need to remove atleast 2 lines from the created flat files. Otherwise you should opt for 3rd party tools like Toad.
Visit www.quest.com - for a free download

HTH

Orashark
Re: Export the result of a query to text file [message #374091 is a reply to message #374075] Thu, 24 May 2001 10:08 Go to previous messageGo to next message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
If you do spool to a file, be sure to include the following:
set trimspool on
set colsep ','
Re: Export the result of a query to text file [message #374104 is a reply to message #374075] Thu, 24 May 2001 20:23 Go to previous message
Sarada
Messages: 27
Registered: April 2001
Junior Member
What is the use of setting TRIMSPOOL on? Can u please clarify me? I hv never used it.

Orashark
Previous Topic: Help! Where clause using TO_DATE
Next Topic: How do I compare two columns in a two different table that are of type LONG?
Goto Forum:
  


Current Time: Mon Dec 23 12:40:31 CST 2024