Hello.
When I want to insert a duplicate row in a table from a console/tool (e.g.: DB Visualizer) I get the following error message:
[Error Code: -803, SQL State: 23505] AN INSERTED OR UPDATED VALUE IS INVALID BECAUSE INDEX IN INDEX SPACE IDXR1PXX CONSTRAINS COLUMNS OF THE TABLE SO NO TWO ROWS CAN CONTAIN DUPLICATE VALUES IN THOSE COLUMNS. RID OF EXISTING ROW IS X'0000000301'.. SQLCODE=-803, SQLSTATE=23505, DRIVER=3.57.82
which is OK.
When I want to run the same query from a
Java application using PreparedStatement.executeBatch() (batch because it could insert more than one row at a time) I get a different error message:
com.ibm.db2.jcc.am.wn: [jcc][t4][102][10040][3.57.82] Batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch.
Use getNextException() to retrieve the exceptions for specific batched elements. ERRORCODE=-4228, SQLSTATE=null
com.ibm.db2.jcc.am.co: A NON-ATOMIC INSERT STATEMENT ATTEMPTED TO PROCESS MULTIPLE ROWS OF DATA, BUT ERRORS OCCURRED
and the error code is
-4228
Why this difference? Did I do something wrong?
I use
DB2 version 9 on
z/OS (DSN09015) and the DB2 driver version is
3.57.82
Any help would be appreciated!