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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Export from Oracle in comma-separated format

Re: Export from Oracle in comma-separated format

From: Vijay Vardhineni <vardhineni_at_worldnet.att.net>
Date: 1997/01/23
Message-ID: <01bc08c2$c4ad4a60$426993cf@default>#1/1

You need to write a script like this

SET pages 0
SET feedback off
SET verify off
SPOOL myfile.lst
SELECT col1||','||col2||','||col3
FROM table_name
WHERE condition_if_any;
SPOOL OFF
SET pages 14
SET feedback on
SET verify on

In the above script, "col1", "col2", "col3" are the columns in the table "table_name". Here value of "col1" is appended to a comma using concatenation operator (||), which in turn concatenated to the value of "col2" etc.

-- 
Vijaya Kumar Vardhineni
Certified Oracle DBA, EDS
Plano, TX

BoB Pierce <rjpierce_at_bga.com> wrote in article <32E64886.5CD_at_bga.com>...

> Is there an easy way to dump an Oracle table in comma-separated format?
> I wrote a simple SQL report, changing the column separator to ',' but
> all the columns are padded with spaces. I just want
> value1,value2,value3 not value1 ,value2 , etc.
>
> Every other DB I've ever seen spits out CSV at the touch of a button.
> Surely I'm missing something here.
>
> Thanks,
>
> Bob Pierce
>
Received on Thu Jan 23 1997 - 00:00:00 CST

Original text of this message

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