今天在做一个WebSPhere Message Broker 简单的练习,使用Compute节点访问oracle数据库.
第一次插入的时候,数据正常插入,没有报错,第二次插入,则报了一个违反唯一约束..是因为表主键不能重复.
解决方案:
把主键设置唯一的就能插入进去.
错误信息:
Insert
Type:INTEGER:5
Text:CHARACTER:INSERT INTO Database.RECORDS ( ID, NAME, ADDRESS, AMOUNT1, AMOUNT2 ) VALUES (oututRecords.id, oututRecords.name, oututRecords.address, CAST(oututRecords.amount1 AS DECIMAL(8, 2)), CAST(oututRecords.amount2 AS DECIMAL(8, 2)) )
DatabaseException
File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbOdbc.cpp
Line:INTEGER:341
Function:CHARACTER:ImbOdbcHandle::checkRcInner
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2321
Text:CHARACTER:Root SQL exception
Insert
Type:INTEGER:2
Text:CHARACTER:-1
Insert
Type:INTEGER:14
Text:CHARACTER:odbc32.dll
DatabaseException
File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbOdbc.cpp
Line:INTEGER:480
Function:CHARACTER:ImbOdbcHandle::checkRcInner
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2322
Text:CHARACTER:Child SQL exception
Insert
Type:INTEGER:5
Text:CHARACTER:23000
Insert
Type:INTEGER:2
Text:CHARACTER:1
Insert
Type:INTEGER:5
Text:CHARACTER:[IBM][ODBC Oracle Wire Protocol driver][Oracle]ORA-00001: unique constraint (SCOTT.SYS_C005425) violated