0

我想通过 SQL Loader 将数据加载到 Oracle 数据库中。这是我的控制文件。我剪掉了中间部分,它不会太长..

OPTIONS (BINDSIZE=512000, ROWS=10000) 
LOAD DATA 
CHARACTERSET UTF8
APPEND
INTO TABLE EIDESWTDOC 
FIELDS TERMINATED BY '~' 
 OPTIONALLY ENCLOSED BY '"' 
TRAILING NULLCOLS (
MANDT CHAR(6)"NVL(:MANDT,' ')"
, SWITCHNUM CHAR(40)"NVL(:SWITCHNUM,' ')"
, POD CHAR(44)"NVL(:POD,' ')"
, SWITCHTYPE "NVL(:SWITCHTYPE, 0.0)"
, OWNER CHAR(20)"NVL(:OWNER,' ')"
, SWTVIEW "NVL(:SWTVIEW, 0.0)"
, MOVEINDATE DATE 'YYYY-MM-DD'
, MOVEOUTDATE DATE 'YYYY-MM-DD'
.....
, SP_INITIATOR CHAR(20)"NVL(:SP_INITIATOR,' ')"
, _IDEXGE_NONFIXED CHAR(2)"NVL(:_IDEXGE_NONFIXED,' ')"
, _IDEXGE_MRPERIO CHAR(4)"NVL(:_IDEXGE_MRPERIO,' ')"
)   

由于以下划线开头的列,我收到语法错误(非字母数字字符的非法组合)。我已经尝试引用它,但没有任何效果。有没有人解决这个问题?

最好的问候,克里斯

4

1 回答 1

1

嗨报价似乎工作。

desc temp ;
Name      Null? Type          
--------- ----- ------------- 
FIRSTNAME       VARCHAR2(255) 
_Address        VARCHAR2(255) 

控制文件

LOAD DATA
  APPEND INTO TABLE TEMP
  FIELDS TERMINATED BY ','
  (FirstName CHAR,
  "_Address" CHAR)

执行日志

$ sqlldr ***/*** control="/home/venkat/Desktop/sqlLoader/load.ctl" data = "/home/venkat/Desktop/sqlLoader/data.txt"

SQL*Loader: Release 11.2.0.2.0 - Production on Wed Nov 21 00:59:36 2018

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Commit point reached - logical record count 2

但是,每当我尝试不引用时,都会得到与您报告的完全相同的错误

控制文件

LOAD DATA
  APPEND INTO TABLE TEMP
  FIELDS TERMINATED BY ','
  (FirstName CHAR,
  _Address CHAR)

执行日志

$ sqlldr ***/*** control="/home/venkat/Desktop/sqlLoader/load.ctl" data = "/home/venkat/Desktop/sqlLoader/data.txt"

SQL*Loader: Release 11.2.0.2.0 - Production on Wed Nov 21 01:05:23 2018

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

SQL*Loader-350: Syntax error at line 5.
Illegal combination of non-alphanumeric characters
  _Address CHAR)
  ^

PS:尝试引用以下划线开头的所有列名。

于 2018-11-20T19:39:22.340 回答