Urgent! - WHEN clause only works for the 1st WHEN in sqlloader [message #73634] |
Tue, 08 June 2004 15:20 |
Sunitha
Messages: 16 Registered: January 2000
|
Junior Member |
|
|
Hi,
I need to load into different columns in a same table based on the values of a column called LIST_NBR.
My current datafile has the following format:
4128002072223683,20026,20030930,20031231,11
4128002072584977,20417,20030930,20031231,11
4128002080241636,20417,20030930,20031231,11
The last two digits are LIST_NBR (Varchar2(5)) on the database. If i use '11' in the first WHEN clause, it works fine!!, but, If i use '11' in the WHEN clause somewhere in the middle or at the end, it doesn't load anything. I says none of the WHEN Clauses were satisfied.
Following is my control file:
LOAD DATA
INFILE '$STAGINGDIR/OLP_TST_LST.DAT'
BADFILE '$STAGINGDIR/OLP_TST_LST.BAD'
TRUNCATE
INTO TABLE EPIMART.EXT_TST_LST_test
WHEN (LIST_NBR = '1')
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
ACCT_NBR CHAR ,
LST01_CELL_VAL_CD CHAR ,
LST01_CELL_EFF_DTE DATE "YYYYMMDD" ,
LST01_CELL_EXP_DTE DATE "YYYYMMDD" ,
LIST_NBR CHAR
)
------*********************************************
INTO TABLE EPIMART.EXT_TST_LST_test
WHEN (LIST_NBR = '2')
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
ACCT_NBR CHAR ,
LST02_CELL_VAL_CD CHAR ,
LST02_CELL_EFF_DTE DATE "YYYYMMDD" ,
LST02_CELL_EXP_DTE DATE "YYYYMMDD" ,
LIST_NBR CHAR
)
The LIST_NBR could be different each time. So, I need to be able to get the WHEN clauses for LIST_NBR 1 thru 25 working, irrespecitve of which WHEN clause is listed first.
If any one has any thoughts, I'd really appreciate it.
Thanks,
Sunitha.
|
|
|
|
|
|