Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: newbie question - Exporting a query into a text file

Re: newbie question - Exporting a query into a text file

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Thu, 24 Jun 1999 21:07:10 GMT
Message-ID: <37747367.20042689@netnews.worldnet.att.net>


On Wed, 23 Jun 1999 17:43:13 -0400, Phong Lam <pnlam_at_us.ibm.com> wrote:

>Is it possible to run a query in Oracle and then dump it into a flat
>text file? I'm running 7.3.4

Yes. You can use the SPOOL command in SQL*Plus. For example:

SPOOL c:\my_output.txt
select * from dual;
spool off

If you want a comma-delimited file, you can do sometihng like this:

set pagesize 0
spool c:\my_output.csv
select x || ',' || y from my_table;
spool off

regards,

Jonathan Received on Thu Jun 24 1999 - 16:07:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US