Re: SQL Loader - loading from flat files

From: Jan Gelbrich <j_gelbrich_at_westfalen-blatt.de>
Date: Tue, 21 Oct 2003 08:47:33 +0200
Message-ID: <bn2kut$rrctu$1_at_ID-152732.news.uni-berlin.de>


"Jan" <j_rieper_at_web.de> schrieb im Newsbeitrag news:ce5b6257.0310201128.681bd677_at_posting.google.com...
> hello,
>
> i've got a problem with the sql loader in oracle 8.1.7. i want to load
> data from a file into an database, but there are difficulties with the
> datatypes.
> the datatype in the database is decimal(15,2) and it fails to load
> from the file when i either don't specify a datatype in the control
> file nor if i use decimal or float. it always rejects some fields or
> loads completly false values.the decimal values in the file are
> separated with a '.'.do i need to use another datatype in the control
> file.hope anyone can help me solve this problem...
>
> thanks,
> jan

Jan,

You may want to ignore the datatypes by having a controlfile like this:

LOAD DATA
INFILE 'myFile.txt'
Replace
INTO TABLE myTable
FIELDS TERMINATED BY ';'
TRAILING NULLCOLS
    (ID
    ,FIRM
    ,DEPT
... and so on ...

    ,WHO
    ,WHEN
   )

So it will be loaded regardless of the datatypes - except if You are going to load varchars into number fields of course ... check this first and then try it.

It is just how the data are delimited inside your file. I used to use ";" in most cases.

hth, Jan Received on Tue Oct 21 2003 - 08:47:33 CEST

Original text of this message