Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Extracting ASCII files from database

Re: Extracting ASCII files from database

From: John P. Higgins <jh33378_at_deere.com>
Date: Sun, 12 Jul 1998 19:13:13 -0500
Message-ID: <35A95118.F8085B89@deere.com>


In order to extract fixed length fields, you may need to use the LPAD or RPAD functions to force the size.

johnvue_at_gte.net wrote:

> Have you considered utilizing database links and doing a "CREATE TABLE
> THISTABLE AS SELECT * FROM THATTABLE_at_SID1" or an "INSERT INTO
> THISTABLE SELECT * FROM THATTABLE_at_SID1". No extra dump file created,
> no need to ftp anything, and no SQL*Loader required.
>
> If those solutions don't apply to your situation for some reason, the
> following .sql script will give a "clean" ASCII output for SQL*Loader
> purposes.
>
> --------- start of script
> --Some of the following options only work in 7.3 and above
> store set /tmp/sqlplus_set_old.sql
> set termout off
> set feedback off
> set heading off
> set echo off
> set colsep ''
> -- make LINESIZE as small as possible
> set linesize 100
> set pagesize 0
> set newpage 0
> set verify off
>
> spool dump.txt
>
> -- put your select statement here
> select user from dual;
>
> spool off
>
> @/tmp/sqlplus_set_old.sql
> !rm /tmp/sqlplus_set_old.sql
> -------- end of script
>
> On Mon, 13 Jul 1998 00:33:32 +0200, Sigrid Staudte
> <sstaudte_at_sachsenlb.de> wrote:
>
> >I have to extract an ASCII file with fixed length of fields from a
> >database table. This file should be transfered to another server and
> >loaded by the sql*loader. Now I´m searching for the best way to extract
> >the ASCII file.
> >Can I use the spool command and sql*plus or is it necessary to write a
> >pl/sql-programm ?
> >Who can give an advice?
> >Who knows a tool what can help to solve the problem ?
Received on Sun Jul 12 1998 - 19:13:13 CDT

Original text of this message

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