Re: Create FLAT file from Oracle table

From: Dave Macpherson <dave_at_fifthd.ca>
Date: 1996/02/23
Message-ID: <4gkpgv$ps9_at_news.sas.ab.ca>#1/1


Carl Merrit <l326048_at_raven.cid.kodak.com> wrote:

>Is there a way to creat a FLAT file from an Oracle table without using
>SPOOL filename and dbms_output.putline? We don't can't to use pro C
>either.
>Is there anything like opening a file and writing to it using PL/SQL?
>HELP!!! Thanks.

You have one option that will work for sure, and a two other options available to you if you are running PL/SQL release 2.3 or Developer/2000.

Using SQL*PLus, you can write a SELECT statement that retrieves the data you want, and spool the output of the query to a file. You will probably requre a few SQL*Plus SET commands to set up your spool file as a proper flat file:

SET NEWPAGE 0
SET PAGES 0
SET FEEDBACK OFF
SPOOL FLATFILE.TXT
SELECT ......
SPOOL OFF The second option available to you is the UTL_FILE package supplied by Oracle with release 2.3 of PL/SQL. This package allows your PL/SQL programs to both read from and write to operating system files.

The Oracle Developer/2000 suite of tools also offers a TEXT_IO package that is virtually identical to the UTL_FILE package. Received on Fri Feb 23 1996 - 00:00:00 CET

Original text of this message