Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Loading data through ctl file

Haisa.MJul 31 2012 — edited Jul 31 2012
Hello 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,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2012
Added on Jul 31 2012
11 comments
527 views