我的csv文件包含如下所示:
year,mon,day
2014,12,01
2013,10,30
和abc的表
create table abc (
year varchar2(4),
mon varchar2(2),
day varchar2(2),
date1 date
)
如何告诉loader.ctl合并年份,星期一,成为日期?
是那样的?OPTIONS (SKIP=11, errors=12000)
LOAD DATA
APPEND INTO TABLE abc (
year "trim (:year)",
mon "trim (:mon)",
day "trim (:day)",
date1 "to_date (year||mon||day,'yyyymmdd')"
)
答案 0 :(得分:2)
fields terminated by ","
。因此,您的控制文件应该如下所示,
OPTIONS (SKIP=11, errors=12000)
LOAD DATA
APPEND INTO TABLE abc
fields terminated by ","
(
year "trim (:year)",
mon "trim (:mon)",
day "trim (:day)",
date1 EXPRESSION "to_date (:year||:mon||:day,'yyyymmdd')"
)