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: SQL*Loader and csv files

Re: SQL*Loader and csv files

From: Stephan Born <stephan.born_at_beusen.de>
Date: Mon, 15 Nov 1999 09:15:14 +0100
Message-ID: <382FC112.9C3C252B@beusen.de>


> Hi,
>
> I'm attempting to get SQL*Loader to transfer a csv file into an Oracle
> database, however, I seem to be running into a bit of a problem.
>
> I tried the following command:
> sqlldr LOG=check.log, DATA=nscp.csv, USERID=vlad/math, CONTROL=nscp.ctl
>
> Here's ctl file:
> LOAD DATA
> INFILE 'nscp.csv'
> INTO TABLE nscp
> (dat date "MM/DD/YY",
> cola float external,
> colb float external,
> colc float external,
> cold float external,
> larg integer external)
>
> The CSV file that I am trying to load into Oracle contains over 200 rows
> similar to the following:
> 1/12/99,64.500,71.500,64.000,71.063,6625200
> 1/11/99,68.938,70.500,64.500,64.500,6818800
> 1/8/99,61.938,65.563,61.875,64.750,4272300
>
> I'd concider using the position keyword, but the variables are separated
> by commas rather than tabs, so the positioning is different for every
> row.
>
> -Mike

This is a ctl-file of my own for loading such files:



options (errors=10000)
LOAD DATA
TRUNCATE
INTO TABLE tmp$endgeraet
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY "'" TRAILING NULLCOLS
(
id sequence (10000),
endgeraet,
verwendungsart,
netzweg,
lfdpa,
lfdweg,
lfdnr,
raum,
kostenst,
installdate "to_date(decode (:installdate, '97.01.80', '07.01.80', :installdate), 'DD.MM.YY')"
)

Regards, Stephan
--


Dipl.-Inf. (FH) Stephan Born   | beusen Consulting GmbH
fon: +49 30 549932-0           | Landsberger Allee 392
fax: +49 30 549932-29          | 12681 Berlin
mailto:stephan.born_at_beusen.de  | Germany
---------------------------------------------------------------
       PGP-Key verfügbar       |      PGP-Key available
---------------------------------------------------------------


Received on Mon Nov 15 1999 - 02:15:14 CST

Original text of this message

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