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: PL/SQL: Reading/Writing to a file

Re: PL/SQL: Reading/Writing to a file

From: Timothy Atwood <tatwood_at_comptree.com>
Date: 1997/09/06
Message-ID: <01bcba75$b7400f60$6384e5cf@station--2>#1/1

To read in a file:

  1. Use SQL*Loader or
  2. Write 'C' import utility that breaks up lines into 1022 byte chunks.
  3. Use the DBMS_LOB package (if using Oracle 8)

To export a file

  1. Best bet is again to write a 'C' program in conjunction with UTL_FILE package at end of 1021 bytes, ad a tilde ~ to indicate line continues, and leave off tilde, to indicate end of the line. The 'C' program will read the information into a character array, and will output the record when it hits a line with no tildes as the last character.

Because we work with the Oracle package with Delphi, and no other tools, I would assume that there might be a third party package that may do what you need. I will see if I can contact my supplier for a possible third party package...

We had a similar problem and went the 'C' programming route for exporting with the UTL_FILE package, and importing we used SQL*Loader. Refer to the Oracle7 Server Utilities Guide provided by Oracle....

Timothy Atwood
847-551-2864

Co-Author - Teach Yourself PL/SQL in 21 Days, SAMS, available 10/31/97

Fenella Tan <fenella_at_voicenet.com> wrote in article <3411FAC5.80E146D2_at_voicenet.com>...
> Can anyone tell me if there is any other way of reading/writing external
>
> text files from PL/SQL ?
> Currently, I'm using the UTL_FILE package, but I recently found out that
>
> it is capable of reading (using the GET_LINE procedure) only 1022 bytes,
>
> and writing (using PUT_LINE) only 1023 bytes. The data I'm working with
>
> will probably be around 7K per line.
>
> Any input is appreciated.
>
> Thanks
> Fenella Tan
>
>
>
>
Received on Sat Sep 06 1997 - 00:00:00 CDT

Original text of this message

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