Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Export from Oracle in comma-separated format
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>...Received on Thu Jan 23 1997 - 00:00:00 CST
> 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
>