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: SQL*Loader for loading, but how to unload data?

Re: SQL*Loader for loading, but how to unload data?

From: Kevin Brand <unixoracle_at_hotmail.com>
Date: Tue, 11 Sep 2001 15:56:48 GMT
Message-ID: <4vqn7.1228$707.302815@news2.rdc2.tx.home.com>

Tom Kyte, Oracle Corporation, has published a great little piece of C code ( PRO*/C ) that does exactly what you want. It utilizes Dynamic SQL Method 4 and will unload the results of virtually any SQL statement into an ASCII delimited file.

You should be able to find this on the ask tom site, however I can email it to you if interested.

An example of its usage, note that the code will write the column definition and all table data to stdout, all other output goes to stderr:

unixprompt:> $ ./tomk -?
usage: ./tomk userid=xxx/xxx sqlstmt=query arraysize=<NN>

unixprompt:> $ ./tomk userid=kevin/kevin sqlstmt='select * from foo'

Connected to ORACLE as user: kevin/kevin

Unloading 'select * from foo'
Array size = 10
COLUMN1|COLUMN2|COLUMN3
barbarbar|1|Y
barbarbar2|2|N
yepyep3|3|N
3 rows extracted
unixprompt:> $

"Marky Mark" <DontSpamMe_at_Nospam.org> wrote in message news:m33rptsgdh1144juhvjlibhrfhte7452rh_at_4ax.com...
> I'm looking for a way to unload data from a table, similar to what I
> can do in Informix with an "Unload to ..." statement.
>
> Is there some way to unload table data to a file from Oracle? I have
> several versions: 7.3.2 8.0.5 and 8.1.6.
>
> Thanks,
> Mark
>
Received on Tue Sep 11 2001 - 10:56:48 CDT

Original text of this message

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