我从sql loader获取以下日志消息。此消息是“未加载行,因为所有WHEN子句都失败了”。一个真正的错误? 最后我有一条日志消息,说总记录读为74256.在ctl控制文件中,我看到每行记录类型的38-39字符 并在此基础上我将插入不同的表格。
Table TEST1_AA:
42233 Rows successfully loaded.
0 Rows not loaded due to data errors.
32023 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Table IIR_TEST2_BB:
0 Rows successfully loaded.
0 Rows not loaded due to data errors.
74256 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Table IIR_TEST3_CC:
31 Rows successfully loaded.
0 Rows not loaded due to data errors.
74225 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Total logical records skipped: 0
Total logical records read: 74256
Total logical records rejected: 0
Total logical records discarded: 1
示例CTL文件
选项(错误= 9999999999,SILENT =(反馈),ROWS = 1000)
加载数据
进入表test_HD
追加
当(038:039)='HD'
时(
record_sequence_no POSITION(029:037)DECIMAL EXTERNAL
,line_type POSITION(040:040)CHAR
,header_record_type POSITION(041:041)CHAR
,enquiry_telephone_number POSITION(042:052)CHAR
,total_amt_last_bill POSITION(053:066)DECIMAL EXTERNAL
,total_payment_received POSITION(067:080)DECIMAL EXTERNAL
)
进入表test_AS
追加
当(038:039)='AS'
时(
record_sequence_no POSITION(029:037)DECIMAL EXTERNAL
,line_type POSITION(040:040)CHAR
,girn POSITION(041:047)CHAR
,charge_desc POSITION(048:077)CHAR
}
答案 0 :(得分:1)
这不是错误。日志告诉你72K记录没有加载到任何地方,因为它们不满足你的任何WHEN条款。
换句话说,在74256条记录中,31条在38和39位置有“HD”或“AS”,其余则没有。你也让它跳过一行(也许第一行是标题行)。
如果您尝试仅加载“HD”和“AS”记录,那么这是一个成功的结果。