9. Ensuring Data Integrity : Integrities : Constraints Compared with Integrities : Differences in Error Handling Between Integrities and Constraints
 
Share this page                  
Differences in Error Handling Between Integrities and Constraints
Constraints and integrities differ in their error-handling characteristics:
If a constraint is defined for a table, an attempt to update the table with a row containing a value that violates the constraint causes the DBMS to abort the entire statement and issue an error.
If an integrity is defined for a table, an attempt to update the table with a row containing a value that violates the constraint causes the invalid row to be rejected, but no error is issued.
Important!  If you mix constraints and integrities in the same table, the integrities are checked first. If a row violates both an integrity and a constraint, the row is filtered out by the integrity before the constraint is checked, and thus does not generate an error message.