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: How does one export an Oracle table to a Comma Delimited Flat File

Re: How does one export an Oracle table to a Comma Delimited Flat File

From: Nancy <nancy_f_at_bigfoot.com>
Date: Wed, 19 Jan 2000 05:40:50 GMT
Message-ID: <38854DA6.D13D16A5@bigfoot.com>


i've use the select filed1||','||field2||','.... from method and it works because it's 1 column- (set heading off, set pagesize 0). the only thing that could go wrong is if you have char datatype padded with spaces- then rtrim(field2)||','||rtrim(field3).......

kIEkko wrote:

> Depending on how automated you want this to be, I've found a couple of
> different ways.
> 1. You can use a decode statement
> 2. Use SQL Navigator from Quest Software. They have a very nice export to
> text file ability that can use any character as a separator.
> 3. If you are doing this in SQL*Plus, try setting the trim on, termout off,
> and spooling on
>
> If you are going to do this manually every once in a while, I would
> definitely recommend SQL Navigator as it has so many capabilities. My job
> became so much easier when I found that program.
>
> Hope that helps.
>
> <budgielover_at_yahoo.com> wrote in message news:82p476$icl$1_at_nnrp1.deja.com...
> > I need to export an oracle table to a csv file by using SQLPLUS
> > I've tried using:
> > SQL>set colsep ","
> > but Oracle tabs all the columns automactically leaving unwanted spaces
> > between fields
> > I've also tried using:
> > select col1||',',col2||',', ... from table_name;
> > but it also has the spacing problem
> >
> > If you know how to solve this or if you know any fancy utility like bcp
> > that will allow exporting table to delimited file.. that will be great!
> >
> > any help will be greatly appreciated!
> >
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
Received on Tue Jan 18 2000 - 23:40:50 CST

Original text of this message

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