In this blog post, let’s learn about the error message “1143 Validation for constraint constraint-name failed; incompatible data exists in referencing base table referencing-table-name and referenced base table referenced-table-name. To display the data that violates the constraint, please use the following DML statement: statement-text.” when working with HPE NonStop SQL/MX, the reason for the error and the solution to fix this error message.
Error Message
1143 Validation for constraint constraint-name failed; incompatible data exists in referencing base table referencing-table-name and referenced base table referenced-table-name. To display the data that violates the constraint, please use the following DML statement: statement-text.
Reason for the Error
You attempted to add a referential integrity constraint that is violated by rows already in the table.
Solution
Run the query statement-text to see the rows that violate the referential constraint. Either change those rows or change the referential constraint definition and resubmit