Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: newbie question - Exporting a query into a text file
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
![]() |
![]() |