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: generate CSV

Re: generate CSV

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 23 Mar 2002 11:23:33 +0100
Message-ID: <1plo9u06gfrprhivo5oej7anmmk7bacrsl@4ax.com>


On Sat, 23 Mar 2002 11:06:05 +0100, "Titi" <thierry.constant2_at_wanadoo.fr> wrote:

>Hi,
>
>simple SQL question for you:
>how can I generate a csv file from a table in oracle ?
>
>something like:
>set head off
>set feed off
>select col1||';',col2||';'... from table_name ;
>
>the columns are in several lines , not one line
>I have problem with col format I think
>
>How can I do that ??
>
>Thanks
>
>
>

First of all you either need to rigorously use
col||';'||col2||';'||col3||';'
etc, so basically return one expression
or use
set colsep ';'
and
select col1,col2,col3 etc.
The linesize can be changed by using the set linesize <n> command.

Hth

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Sat Mar 23 2002 - 04:23:33 CST

Original text of this message

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