|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
exception after check constraint
Hi
i wrote a check contraint in a table similar like this ALTER TABLE TEST ADD CONSTRAINT CHK_TEST_DATE check (DATE1 <= DATE2); is it possible do write my own exception when the constraint definition is false? |
|
#2
|
||||
|
||||
|
Instead of using a Check Constraint, you could check the condition using a trigger and raise an exception there. Take a look at the Data Definition .pdf documentation. Under the Stored Procedure section (page 165), they explain how to create a custom exception. In the next chapter under Triggers (page 192), they explain how to check the data for a condition whenever a change occurs and raise an exception if necessary.
|
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > exception after check constraint |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|