Re: Easy way to dump table to flat file?

From: Roel Eckhardt <re_at_albast.knoware.nl>
Date: Tue, 21 Feb 1995 00:38:06 GMT
Message-ID: <D4Br3I.H6x_at_knoware.nl>


In article <3hu6kr$924_at_linus.mitre.org>, vv_at_mbunix (Vincent A Ventrone) says:
>
>A colleague has asked me to describe the easiest way to dump
>an Oracle table to a flat Unix file--and I did not have a ready answer.
>

The easiest way to do this is using SQL*Plus and the 'spool' command , which captures all the screen output to a named file.

in SQL*Plus:
1. first open a spool file:

                    SPOOL  <filename>

2. Select the required fields (probably all) from the table with

   the SQL select statement.

                    SELECT * FROM ....
3. close spool file: 
                    SPOOL OFF

In order to make your spoolfile look more like a data flat-file specify some setting first in SQL*Plus, like:

  • SET SPACE 0 (set field spacing from 1 (default) to zero)
  • SET LINESIZE <#> (total # of characters of all the fields = record size)
  • SET HEADING OFF (eliminates the column headings)
  • SET FEEDBACK OFF (eliminates the '# rows selected' remark)
Received on Tue Feb 21 1995 - 01:38:06 CET

Original text of this message