In this post, you’ll learn about the error message -803 an inserted or updated value is invalid because the index in index space indexspace name constrains columns of the table so no two rows can contain duplicate values in those columns.� rid of existing row is x’rid’ in the IBM DB2 database , the reason why it occurs along with the solution to fix it
IBM DB2 Error Message
-803 an inserted or updated value is invalid because the index in index space indexspace name constrains columns of the table so no two rows can contain duplicate values in those columns.� rid of existing row is x’rid’
Reason for the Error
Duplicate key on insert or update
The table that is the object of the INSERT or UPDATE operation is constrained (by UNIQUE INDEX in the INDEX SPACE ‘indexspace name’) to have unique values in certain columns.� Completion of the requested INSERT or UPDATE would result in duplicate values occurring in row ‘rid’.If a view is the object of the INSERT or UPDATE statement, the table that defines the view is constrained.� The update might also be caused by a DELETE operation of a parent row that cascades to a dependent row with a delete rule of SET NULL.
Solution
Examine the definitions for UNIQUE INDEX in the INDEX SPACE ‘indexspace name’ to determine the uniqueness constraint imposed.� Please refer to SYSIBM.SYSINDEXES for the ‘indexspace name’ and the associated ‘index name’. For an UPDATE statement, verify that the specified operation is consistent with the uniqueness constraint.� If this does not indicate the error, examine the object table to determine the cause of the problem.For an INSERT statement, examine the object table to determine which values violate the uniqueness constraint.� If the INSERT statement contains a subquery, match the contents of the table addressed by the subquery and the contents of the object table to determine the cause of the problem. For a DELETE statement, examine the index key columns in the table that defines the index.� These columns contain a foreign key, which when set NULL on a cascade delete from the object table, causes the duplicate values.