Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: generating a text file of a table
Hi.
There are some problems in creating accurate CSV file:
Examples:
Column data CSV data ----------- --------- aaaa aaaa bb,b "bb,b" bb"b "bb""b"
This is CVS format.
You can take a converter that converts database data into CSV
format at:
http://www.simtel.net/pub/simtelnet/win95/database/chyfo171.zip
(version 1.7.1, 30k size, platform Win95/98/NT/2000)
if you want to create CSV file from your program use CreateProcess for running this utility. It is fully automated by command prompt parameters.
Best regards, Dmitry
In article <91comf$gtm$1_at_nnrp1.deja.com>,
tshbedford_at_my-deja.com wrote:
> Thanks Jay,
> I've got that working fine as command line entries but I can't get it
> to run as a script. Do you know the URL of an idiot's guide to
> writing and running scripts (I'm a total Oracle novice).
> Ultimately I want to be able to create csv files from a C++
> application.
> I'm surprised that an established product like Oracle hasn't got a
> simpler method of generating text files of data.
>
> Tim
>
> >
> > Hey Tim,
> >
> > If you just want text and fixed width will do it for you:
> >
> > SQL> spool c:\temp\table_text.txt
> > SQL> select * from your_table_name;
> > .
> > .
> > .
> > SQL> spool off
> >
> > And you will have a simple text file with the output. If you
need CSV one solution would be change the select to:
> >
> > SQL> select field1 || ',' || feild2 || ',' || feild3 || ',' ||
field4
from your_table_name;
> >
> > Jay!!!
> >
> > tshbedford_at_my-deja.com wrote:
> >
> > > Oops, I thought my first message had failed to up load. Sorry for
repeating
> > > myself.
> > >
> > > Tim
> > >
> > > In article <91ab3b$h16$1_at_nnrp1.deja.com>,
> > > tshbedford_at_my-deja.com wrote:
> > > > Can anyone tell me how to generate a simple text file (csv) of a
table's
> > > > contents? thanks
> > > >
> > > > Tim
> > > >
Sent via Deja.com
http://www.deja.com/
Received on Sat Dec 16 2000 - 09:31:21 CST