Home » RDBMS Server » Server Utilities » Manipulating a CSV file load in sqlldr
Manipulating a CSV file load in sqlldr [message #72295] Fri, 02 May 2003 11:35 Go to next message
Ummati
Messages: 1
Registered: May 2003
Junior Member
Hi:

I am trying to load values from a CSV file into a table that and face 2 issues. Any help from the guru's in this forum will be appreciated. thx.

Issue#1. Field 3 in the CSV file is 17 characters long. But during the load it has to be split into two parts - the first 10 characters go into col1 and the last 7 characters go into col2. How do I do this with sqlldr?

Issue#2. Moreover the actual table has less columns than the CSV file. The 4th and 7th columns are not required to be loaded. How to make sqlldr understand this?

thx again (in anticpation).

from
a-novice-DBA-whose-boss-expects-miracles
Re: Manipulating a CSV file load in sqlldr [message #72300 is a reply to message #72295] Mon, 05 May 2003 04:30 Go to previous message
deepa@isoftel.com
Messages: 1
Registered: May 2003
Junior Member
ISSUE #1:

LOAD DATA
INFILE * INTO TABLE test
(c1 char(10) "substr(:c0l1,1,10)" ,
c2 char(7) "substr(:c0l1,11,17)"
)
BEGINDATA

u can use substring operations on the column

ISSUE#2:

for the unwanted fields u can specify the filler char in the control file

for ex:

LOAD DATA
INFILE * INTO TABLE
test FIELDS TERMINATED BY ","
( c1 INTEGER,
c2 FILLER CHAR,
c3 CHAR )
BEGINDATA

:
:
:

If your table contains only c1 and c3 fields, then user FILLER CHAR to ommit the c2
Previous Topic: Automating Export/Import of 8i db in NT4
Next Topic: Importing .dmp file made in Oracle8i to Oracle8
Goto Forum:
  


Current Time: Wed Jun 26 12:59:40 CDT 2024