DB2 錯誤代號 筆記

來源:互聯網
上載者:User



返得利購物   http://www.bbuy8.com

購物返利天經地義,返利不高,叫毛返利


(1) SQL State: 42831

[Error Code: -542, SQL State: 42831]  DB2 SQL Error: SQLCODE=-542, SQLSTATE=42831, SQLERRMC=BATCH_NO, DRIVER=3.57.82

列子:                                                                                               

Create  table   T_USER_IMPORT_BATCH(                                               
BATCH_NO  char(15)  not null primary key,                                            
STATUS    Char(1)       not null,
CREATE_TIME   char(14)  not null,
CREATER    varchar(30)  not null,
AUDIT_TIME char(14),
AUDITER    Varchar(30),
FILE_NAME  Varchar(300) not null,
MEMO       Varchar(500)
)

 更改為以下   OK   

Create  table   T_USER_IMPORT_BATCH(
STATUS    Char(1)       not null,
CREATE_TIME   char(14)  not null,
CREATER    varchar(30)  not null,
AUDIT_TIME char(14),
AUDITER    Varchar(30),
FILE_NAME  Varchar(300) not null,
MEMO       Varchar(500)
)


錯誤原因 : 可以為空白的列不允許作為主健的一部分包含在內 。   意思是作為主鍵,必須加上NOT  NULL 屬性。


(2) Error Code: -104, SQL State: 42601

 [Error Code: -104, SQL State: 42601]  DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=TABLE;DELETE ;JOIN

例子:

DELETE TABLE T_USER_IMPORT_DETAIL

改為以下文法 OK

DROP  TABLE T_USER_IMPORT_DETAIL;

錯誤原因: SQL語句中由非法字元  其實也就是尼瑪 語法錯誤

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.