Finding a violated referential or check constraint
When you receive an SQL error because of a constraint violation, look at the SQLCA for specific information.
About this task
Question: When a referential or check constraint has been violated, how do I determine which one it is?
Answer: When you receive an SQL error because of a constraint violation, print out the SQLCA. You can use the DSNTIAR routine to format the SQLCA for you. Check the SQL error message insertion text (SQLERRM) for the name of the constraint. For information about possible violations, see SQLCODEs -530 through -548.