![](/img/trans.png)
[英]How to write an error message from an BCP operation to a log file and stop processing the batch file.
[英]Fatal Error message in log file
我尝试使用sql loader加载时,在日志文件中生成了一条重大错误消息
我用这个创建了一个名为Ad2.ctl的控制文件
和加载命令
sqlldr scott/tiger@MYDB CONTROL='Ad2.ctl' LOG='Ad2.log'
文件的内容包括以下示例
运行sql loader命令后,出现一长串错误,并且未填充ADDRESS表。
错误包括以下内容
SQL*Loader: Release 10.2.0.3.0 - Production on Wed Sep 12 08:47:28 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: Ad2.ctl
Data File: Abbeyruntest2.csv
Bad File: Abbeyruntest2.bad
Discard File: Abbeyruntest2.dis
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table ADDRESS, loaded from every logical record.
Insert option in effect for this table: APPEND
Record 2: Rejected - Error on table ADDRESS, column ADDRESSAREA.
Column not found before end of logical record (use TRAILING NULLCOLS)
Record 3: Rejected - Error on table ADDRESS, column ADDRESSAREA.
Column not found before end of logical record (use TRAILING NULLCOLS)
将长错误发布为新蜜蜂的应用程序对此感到困惑。
看来问题出在您的csv文件中的引号中。
我在这里找到有关如何加载此类文件的文章。
LOAD DATA
APPEND INTO TABLE testing
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(
a
,b "replace ( :b ,'"' ,'' )"
)
CSV文件与控制文件完全不对应。 CSV文件中的逗号过多-根据“,”子句的FIELDS TERMINATED BY','子句,每个逗号分隔一个新字段。 因此,我修改了您的数据,并成功了:
1,FLAT, ,1 ,Abesinia Passage ,
2,Flat e-1,Edmund's Home ,1a ,Arena's Palace Lane,
3,flat 1,`Anderson's House',11a, ,Laguna Estate
如果您无法修改CSV文件,则需要在控制文件中定义FILLER字段,以使字段规范与实际数据保持一致。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.