sqlldr:ORA-00911:无效字符

时间:2015-10-27 10:03:24

标签: sql-loader ctl

我想导入csv文件。我的剧本是:

@echo off
set numid=2015092510524361378197540100
sqlldr USER@db/PSW data=csv\2015092510524361378197540100.csv control=ctl\control.ctl log=log\2015092510524361378197540100.log bad=bad\id.bad
pause 

我的表是:

CREATE TABLE SV (NO1 VARCHAR2(255),NAMA VARCHAR2(255),ALAMAT VARCHAR2(255),id VARCHAR2(20),JAB VARCHAR2(50),numid VARCHAR(55));

我的control.ctl是:

OPTIONS (SKIP=43, errors=12000) LOAD DATA  APPEND INTO TABLE sv when NAMA <> '' FIELDS TERMINATED BY ',' optionally enclosed by '"' TRAILING NULLCOLS (no filler,no1 "TRIM (:no1)",nama "TRIM (:nama)", alamat "TRIM (:alamat)",id "TRIM (:id)",jab "TRIM (:jab)",numid "%numid%")

错误是:

Record 10: Rejected - Error on table sV, column numid.
ORA-00911: invalid character
请告诉我哪一个错了。谢谢所有

1 个答案:

答案 0 :(得分:1)

由于numid是VARCHAR2(55),因此将表数据类型更改为VARCHAR2并将控制文件更改为:

numid "TRIM(:numid)"