我的文件名 .dat 文件包含以下格式的 1000 条记录。
SIC_ID|NAME|CHANGED_DATE|LOGICALLY_DELETED
110|Wheat|31/10/2010 29:46:00|N
我要在其中提供内容的表还有几列。我希望将这些列留空,因为 .dat 文件中没有内容。表列:
SIC_ID, NAME, CREATED_USER_ID ,CREATED_DATE ,CHANGED_USER_ID ,CHANGED_DATE,LOGICALLY_DELETED,RECORD_VERSION
我的控制文件如下:-
OPTIONS (DIRECT=TRUE,SKIP=1)
LOAD DATA CHARACTERSET WE8MSWIN1252
INFILE "mic_file.dat"
BADFILE "sql/mic_file.bad"
REPLACE
INTO TABLE SDS_SIC
FIELDS TERMINATED BY "|"
TRAILING NULLCOLS
(SIC_ID, NAME,
DATE "DD/MM/YYYY HH24:MI:SS" NULLIF (CHANGED_DATE=BLANKS),
LOGICALLY_DELETED)
运行 SQL*Loader 后,我看到以下错误:
Column Name Position Len Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
SIC_ID FIRST * | CHARACTER
NAME NEXT * | CHARACTER
CHANGED_DATE NEXT * | CHARACTER
LOGICALLY_DELETED NEXT * | CHARACTER
Record 1: Rejected - Error on table SDS_SIC, column CHANGED_DATE.
ORA-26041: DATETIME/INTERVAL datatype conversion error
最后两行错误被多次抛出。现在已修复:)
错误 2:LOGICALLY_DELETED 只有 2 个可能的值 - Y 或 N。
Record 51: Rejected - Error on table SDS_SIC, column LOGICALLY_DELETED.
ORA-12899: value too large for column LOGICALLY_DELETED (actual: 2, maximum: 1)
上述错误多次显示。