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: Using PL/SQL 2.1 to write to a flat file

Re: Using PL/SQL 2.1 to write to a flat file

From: Peter Schneider <pschneider.ctj_at_metronet.de>
Date: 1997/11/12
Message-ID: <3468f6fa.3768995@pop-news.metronet.de>#1/1

On Tue, 11 Nov 1997 16:45:39 -0500, Patrick Tan <ptan_at_mindspring.com> wrote:

>Rob,
>
>Use a procedure to write the output data to a temporary table. then
>write a SQLPLUS script to spool the output to a flat file. Use plenty of
>COLUMN ... FORMAT statement in your SQLPLUS script to format your
>output.
>
>
>Patrick
>

Hi Patrick,

there are some additional points to consider: Things should keep working if two or more users will concurrently perform this export, so it's a good idea to include a column session_id in the temporary table. In the procedure, use USERENV('SESSIONID') when inserting rows, and in the script select only those rows that match your sessionid. To have it be done reasonably fast, one can SET TERMOUT OFF before the query, and SET TRIMSPOOL ON keeps files as small as possible.

HTH,
Peter

Peter Schneider
pschneider.ctj_at_metronet.de Received on Wed Nov 12 1997 - 00:00:00 CST

Original text of this message

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