SQL错误:ORA-00917:缺少逗号

时间:2017-08-03 08:08:09

标签: oracle

当我尝试使用Oracle SQL Developer工具将数据插入oracle时出现以下错误。

命令行错误:54列:2 错误报告: SQL错误:ORA-00917:缺少逗号 00917. 00000 - "缺少逗号" *原因:
*操作:

我无法发现任何错误。我的SQL如下。有人可以帮我吗?

INSERT INTO MS9.MYTAB(
2001_ACCOUNT_STATUS,
2001_CDP_ACCOUNT_NO,
2001_EMAIL_ADDRESS,
2001_LOGIN_FAIL_CNT,
2001_MAILING_ADDRESS_ID,
2001_MOBILE_CTY_CD,
2001_MOBILE_NO, 
2001_OFFICE_TEL_CTY_CD, 
2001_OFFICE_TEL_NO,
2001_OTP_SECURITY_CD,
2001_REGISTER_DT, 
2001_RESIDENT_ADDRESS_ID, 
2001_ID,
2001_USER_ID,
2001_USER_ID_TYPE,
 2001_USER_ID_TYPE_OTH,
 2001_USER_NAME,
 2001_USER_TYPE,
 2001_VERIFY_STATUS,
 LAST_UPDATED_TIME,
 CREATED_TIME,
 CREATED_BY,
 LAST_UPDATED_BY,
 2001_PWD_CHANGED_DT,
 TRANSACTION_ID,
 VERSION_NO)
VALUES(
'A',
null,
'jxxxxxso@baml.com',
4,
'a9a0d8a7-8ac2-4b76-a70d-08c4f188da93',
'65',
'12345678',
null,
'23456789',
'63ACF060850971EFE22928E62B9EAD==',
'42684',
'a9a0d8a7-8ac2-4b76-a70d-08c4f188da93',
'TD1611100003',
'GAxxxx678',
'P',
null,
'Name 1',
'C',
'V',
'10-Nov-16',
'10-Nov-16',
'System',
'Name 1',
'10-Nov-16',
'testtransactionid111',
9};
表格如下:

2001_ID                     NVARCHAR2(12 CHAR)  
2001_USER_TYPE              VARCHAR2(50 BYTE)   
2001_USER_ID_TYPE           VARCHAR2(50 BYTE)   
2001_USER_ID_TYPE_OTH       NVARCHAR2(100 CHAR) 
2001_USER_ID                NVARCHAR2(20 CHAR)  
2001_USER_NAME              NVARCHAR2(66 CHAR)  
2001_RESIDENT_ADDRESS_ID    NVARCHAR2(36 CHAR)  
2001_MAILING_ADDRESS_ID     NVARCHAR2(36 CHAR)  
2001_ACCOUNT_STATUS         VARCHAR2(50 BYTE)   
2001_VERIFY_STATUS          VARCHAR2(50 BYTE)   
2001_REGISTER_DT            DATE                
2001_LOGIN_FAIL_CNT         NUMBER(2,0)         
2001_EMAIL_ADDRESS          NVARCHAR2(320 CHAR) 
2001_OFFICE_TEL_CTY_CD      VARCHAR2(3 BYTE)    
2001_OFFICE_TEL_            VARCHAR2(12 BYTE)   
2001_MOBILE_CTY_CD          VARCHAR2(3 BYTE)    
2001_MOBILE_                VARCHAR2(12 BYTE)   
2001_CDP_ACCOUNT_           VARCHAR2(12 BYTE)   
2001_OTP_SECURITY_CD        VARCHAR2(50 BYTE)   
CREATED_TIME                DATE    
CREATED_BY                  NVARCHAR2(256 CHAR) 
LAST_UPDATED_TIME           DATE    
LAST_UPDATED_BY             NVARCHAR2(256 CHAR) 
VERSION_                    NUMBER  
TRANSACTION_ID              VARCHAR2(50 BYTE)   
2001_PWD_CHANGED_DT         DATE    

2 个答案:

答案 0 :(得分:3)

您的SQL语句以}而不是)结束。

答案 1 :(得分:0)

在查询末尾删除大括号(})并按以下方式更改查询

INSERT INTO 
MS9.MYTAB
(
2001_ACCOUNT_STATUS, 2001_CDP_ACCOUNT_NO, 2001_EMAIL_ADDRESS, 2001_LOGIN_FAIL_CNT,
2001_MAILING_ADDRESS_ID, 2001_MOBILE_CTY_CD, 2001_MOBILE_NO, 2001_OFFICE_TEL_CTY_CD, 
2001_OFFICE_TEL_NO, 2001_OTP_SECURITY_CD, 2001_REGISTER_DT, 2001_RESIDENT_ADDRESS_ID, 
2001_ID, 2001_USER_ID, 2001_USER_ID_TYPE, 2001_USER_ID_TYPE_OTH,
2001_USER_NAME, 2001_USER_TYPE, 2001_VERIFY_STATUS, LAST_UPDATED_TIME,
CREATED_TIME, CREATED_BY, LAST_UPDATED_BY, 2001_PWD_CHANGED_DT,
TRANSACTION_ID, VERSION_NO
 )
VALUES
(
'A', null, 'jxxxxxso@baml.com', 4,
'a9a0d8a7-8ac2-4b76-a70d-08c4f188da93', '65', '12345678', null,
'23456789', '63ACF060850971EFE22928E62B9EAD==', '42684', 'a9a0d8a7-8ac2-4b76-a70d-08c4f188da93',
'TD1611100003', 'GAxxxx678', 'P', null,
'Name 1', 'C', 'V', '10-Nov-16',
'10-Nov-16', 'System', 'Name 1', '10-Nov-16',
'testtransactionid111', 9
);