Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: SPOOL Problem
Well, I've solved the problem without SQL*Plus. There is a very useful post
on ASKTom:
[url]http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:459020243348[/url]
There's the source code for a Pro*C solution. You can compile it yourself.
But I add a new line to include <SQLCA.H>. I don't know if the code is not
complete for Oracle 9i. It works. And I complete unloading an 8GB text file
in less than an hour. ^_^
On 6/7/06, Yongping Yao <yaoyongping_at_gmail.com> wrote:
>
> Thanks a lot.
> I will try UTL_FILE.
> I "unload" data to feed a linux-based program. That program uses text
> files as input and I cannot modify it :( .
> I'm now reading http://asktom.oracle.com/~tkyte/flat/index.html<http://asktom.oracle.com/%7Etkyte/flat/index.html>.
> It seems a useful solution.
>
> BTW, I tried to search on Metalink. There's no hits.
>
> On 6/7/06, Graeme.Farmer_at_mincom.com <Graeme.Farmer_at_mincom.com> wrote:
>
> > You would probably be best to write a PL/SQL procedure to achieve this
> > making use of UTL_FILE to write directly to a file rather than via the SPOOL
> > mechanism in SQL*Plus.
> >
> >
> >
> > Using PL/SQL gives the ability to perform BULK fetches from the source
> > data too which can significantly improve performance.
> >
> >
> >
> > If you look hard enough, you will probably find some code on the web
> > that will unload to CSV or SQL*Loader format text files.
> >
> >
> >
> > What is the purpose of writing the tables to text file? Do you need to
> > archive the data in a portable format? Loading data to another system?
> > Different platform/rdbms?
> >
> >
> >
> > Cheers
> >
> > * *
> >
> > *Graeme Farmer *
> >
>
> --
> Yao Yongping
> Learning Oracle, UNIX/Linux...
> Love Reading, Classical Music, Philosophy, Economics etc.
> Blog: http://spaces.msn.com/members/yaoyp/
>
-- Yao Yongping Learning Oracle, UNIX/Linux... Love Reading, Classical Music, Philosophy, Economics etc. Blog: http://spaces.msn.com/members/yaoyp/ -- http://www.freelists.org/webpage/oracle-lReceived on Wed Jun 07 2006 - 05:34:29 CDT
![]() |
![]() |