oracle sqlldr使用(导入速度快,但对数据本身的处理功能弱)
博客分类:
sqlload.cmd
Sql代码
- pause
- sqlldr user/[email protected] control.ctl skip=1 rows=2000 bindsize=8192000
- pause
control.ctl
Sql代码
- 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)"
- )
时间: 2024-10-25 19:04:38