Re: Exporting data to ASCII files - HOW?

From: Janene Carey <janene_at_metz.une.edu.au>
Date: 29 Jun 93 08:09:53 GMT
Message-ID: <1230_at_grivel.une.edu.au>


Reply-To: janene_at_metz.une.edu.au
Newsgroups: comp.databases.oracle
References: <7504.2c2aaa9f_at_hayes.com>

From article <7504.2c2aaa9f_at_hayes.com>, by fgreene_at_hayes.com:

> In article <1993Jun24.062259.22494_at_alf.uib.no>, Gunnar.Sylthe_at_nsd.uib.no writes:
>> We need to export data from Oracle tables to ASCII files. Is there an easy way to do this?
>> 
>> --Gunnar

>
> Assume that you have a table containing fields NAME, ACCT_NO and
> LAST_SALE_DATE where LAST_SALE_DATE might be a null value.
>
> To extract to an ASCII (flat) file use the following:
>
> SET PAGESIZE 0 -- turns off all formatting, column heads, etc
> SPOOL THE_FILE -- turn on the spooler for output
> SET LINESIZE 132 -- needed if the output is over 80 columns

Last time I tried this the user needed all data for a record on one line, and this meant hundreds of columns and the biggest LINESIZE allowable (was it 500? I don't remember) was not big enough. We could have made it if the fields had not been padded with blanks, or if RTRIM could be used to strip trailing blanks. All in all I found it a frustrating exercise and was amazed that it was not more easy!

.. deleted stuff about how to do the select statement..



Janene Carey, Computing Services, University of New England, Armidale, 2351, NSW, Australia. Email: janene_at_metz.une.edu.au Phone: +61 67 73 2287 Fax: +61 67 73 3272

       Any views expressed are mine own hard won ones


Received on Tue Jun 29 1993 - 10:09:53 CEST

Original text of this message