sqlldr Field in data file exceeds maximum length

lovestanford發表於2016-04-23

sqlldr 匯入時報如下錯誤:

Record 1: Rejected - Error on table INFOBASE, column CONTENT.
Field in data file exceeds maximum length
Record 2: Rejected - Error on table INFOBASE, column CONTENT.
Field in data file exceeds maximum length

我的控制檔案為

OPTIONS ( DIRECT=TRUE)
LOAD DATA
INFILE '/u/oracle/cdrd/sms_data/hebei_yd/hb_yd_sms_content.txt'
BADFILE '/u/oracle/sqlldr/log/hebei_yd/hb_yd_sms_content.bad'
DISCARDFILE '/u/oracle/sqlldr/log/hebei_yd/hb_yd_sms_content.dsc'
INTO TABLE "ETL"."HB_YD_SMS_CONTENT"
TRUNCATE
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(sms_id,
category_id,
areas_id,
sms_type,
content )

表定義為:

CONTENT欄位為varchar2(4000 char)

解決:

控制檔案修改為:

OPTIONS ( DIRECT=TRUE)
LOAD DATA
INFILE '/u/oracle/cdrd/sms_data/hebei_yd/hb_yd_sms_content.txt'
BADFILE '/u/oracle/sqlldr/log/hebei_yd/hb_yd_sms_content.bad'
DISCARDFILE '/u/oracle/sqlldr/log/hebei_yd/hb_yd_sms_content.dsc'
INTO TABLE "ETL"."HB_YD_SMS_CONTENT"
TRUNCATE
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(sms_id,
category_id,
areas_id,
sms_type,
content char(20000)
)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21754115/viewspace-2086546/,如需轉載,請註明出處,否則將追究法律責任。

相關文章