Chapter 6. Moving business rules to the database 69
there are situations where the existing methods of checking for errors make more sense than
checking for constraint violations. For example, if you are already chaining to the customer
master file to retrieve the customer name, it makes sense to handle invalid customer
numbers at the same time, using the same methodology as you currently use.
Another issue to consider is how easily you can determine which constraint failed. SQL, RPG,
and COBOL all signal constraint violations. However, if multiple constraints are assigned to a
table, as is generally the case, you must retrieve the specifics concerning which constraint
failed using the Receive Program Message API. In addition, constraint viola ...