Loading data through ctl file
Haisa.MJul 31 2012 — edited Jul 31 2012Hello All,
I have a ctl file for loading data and it works fine but the problem is, it does not load data which has a date with the year of 2000. for example: if the date is 04/Feb/2000, it does not load that row of data. Could you please advise me, how I can fix this problem. It seems easy but I can not manage it.
Here is my code:
load data
infile 'C:\OLM_API\OLMHISTORY.CSV'
replace
into table OLM_HISTORY_CLASS
WHEN (1) != ','
fields terminated by "," optionally enclosed by '"'
(OLM_NUMBER CHAR "decode(length(:OLM_NUMBER),1,'0000'||:OLM_NUMBER,
2,'000'||:OLM_NUMBER,3,'00'||:OLM_NUMBER,
4,'0'||:OLM_NUMBER,:OLM_NUMBER)",
OLM_NAME,
OLM_DATE_OF_CLASS date "MM/DD/YYYY",
OLM_COURSE_CODE,
OLM_COURSE_NAME,
OLM_OFFERING,
OLM_CLASS
)
Thanks,