sqlload.cmd
control.ctl
pause
sqlldr user/pass@tnsdb control.ctl skip=1 rows=2000 bindsize=8192000
pause
control.ctl
LOAD DATA
INFILE 'Rating201001.csv'
APPEND
INTO TABLE "TBL_SELL"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
--FIELDS TERMINATED BY ','
-- 表的字段没有对应的值时允许为空
TRAILING NULLCOLS
-- 下面的字段顺序对应csv文件中逗号分隔后的字段顺序,可以用:字段名来引用其他列的值
(
SRC_TYPE_CODE,
-- YEAR_MONTH "201002", 忽略第二列值而使用固定值
YEAR_MONTH,
P_INDEX,
PROVINCE,
CITY,
COUNTRY,
SHOP_NAME "trim(:SHOP_NAME)",
SHOP_CODE,
BRAND_NAME,
SELL_COUNT,
SELL_MONEY,
SHOP_RATING,
TYPE_CODE "decode(:SRC_TYPE_CODE,10,5,:SRC_TYPE_CODE)"
)