SQL*LOADER - Inserting values in wrong column [message #226188] |
Thu, 22 March 2007 15:05 |
bswarmer
Messages: 5 Registered: December 2006
|
Junior Member |
|
|
Howdy,
I am attempting to load a file into Oracle via sqlldr. The input file is a tab delimited file that is made up of the follwing columns: CUST_NBR ,FIRSTNAME,LASTNAME,ADDRESS,ADDRESS2,CITY,STATE,ZIPCODE,ATT_CODE
The problem is that ADDRESS2 is often null and rather than inserting a null into the ADDRESS2 column, it is shifting all remaining columns over 1. So Address2 is actually populated with the CITY and CITY is populated with the STATE...
I have tried with and without the NULLIF statements and am out of ideas. Below is my control file.
OPTIONS ( DIRECT=TRUE)
LOAD DATA
INFILE "CustInfo.txt"
BADFILE "C:\NCOA\test.bad"
DISCARDFILE "C:\NCOA\test.dsc"
TRUNCATE
INTO TABLE 70322_ALL_CUST
FIELDS TERMINATED BY " " OPTIONALLY ENCLOSED '"'
TRAILING NULLCOLS
(CUST_NBR NULLIF (CUST_NBR=blanks)
,FIRSTNAME NULLIF (FIRSTNAME=BLANKS)
,LASTNAME NULLIF (LASTNAME=BLANKS)
,ADDRESS NULLIF (ADDRESS=BLANKS)
,ADDRESS2 NULLIF (ADDRESS2=BLANKS)
,CITY NULLIF (CITY=BLANKS)
,STATE NULLIF (STATE=BLANKS)
,ZIPCODE NULLIF (ZIPCODE=BLANKS)
,ATT_CODE NULLIF (ATT_CODE=BLANKS))
Thank you in advance for any help with this.
Brad
|
|
|
|
|
|
|