Subject | Check Constraint - Custom Exception |
---|---|
Author | sasidhardoc |
Post date | 2006-03-26T09:37:04Z |
I have a check constraint:
ALTER TABLE EMPLOYEE ADD CONSTRAINT C_EMPLOYEE
CHECK (
new.GENDER <>'M'
);
and an Exception as:
CREATE EXCEPTION EXC_BAD_GENDER 'Wrong sex!!';
How do I raise the Exception EXC_BAD_GENDER when the check constraint
fails? TIA
ALTER TABLE EMPLOYEE ADD CONSTRAINT C_EMPLOYEE
CHECK (
new.GENDER <>'M'
);
and an Exception as:
CREATE EXCEPTION EXC_BAD_GENDER 'Wrong sex!!';
How do I raise the Exception EXC_BAD_GENDER when the check constraint
fails? TIA