Re: TXT-File Import / Export
Date: Mon, 23 Jul 2001 01:48:25 GMT
Message-ID: <JnL67.24197$cK1.7516379_at_typhoon.jacksonville.mediaone.net>
if you do this file often replace:
INFILE *
with name of file to load
and skip begin data portion in script
"Lazar Ivancevic" <lai_at_propack-data.com> wrote in message
news:3B39B185.FBD124D6_at_propack-data.com...
Sybrand Bakker wrote:
"HJM" <hjm_at_online.de> wrote in message
news:9ha6ov$ri0$05$1_at_news.t-online.com...
> often ask...i know...
> I want to import a ASCII-text file into the database.
>
> file-layout in/out:
> name1 20sign alphanumeric
> name2 20sign alphanumeric
> price 10sign numeric
> no delimiter, cr+lf at the end of each line.
>
> i think i have to use the sqlldr with a control-file. Where to
find
> documentation about?
>
> thanks for your help!
> Hans-J rgen
>
>
>
MyFile.CTL
LOAD DATA
INFILE * -- data in same file or separate myfile.dat
REPLACE
INTO TABLE MyTable
(
name1 POSITION(1:20) CHAR "LTRIM(RTRIM(:name1))"
,
name2 POSITION(21:40) CHAR "LTRIM(RTRIM(:name2))"
,
price POSITION(41:50) DECIMAL EXTERNAL NULLIF STATARP=BLANKS
"TO NUMBER(:price,'9999999.99')"
)
BEGINDATA
Name1 7890123456790Name2 7890123456790 23.12 -- can be
myfile.dat
Namex 7890123456790Namey 7890123456790 123.68
..
Import Data with
sqlldr userid=myuser/mypwd_at_mydb control=myfile.ctl
or
sqlldr userid=myuser/mypwd_at_mydb control=myfile.ctl
data=myfile.dat
Oracle Server Utilities Manual.
online at http://technet.oracle.com
Hth,
Sybrand Bakker, Oracle DBA
--
Lazar Ivancevic
--Received on Mon Jul 23 2001 - 03:48:25 CEST