Is it possible to create a table constraint that would reject records not meeting a specific constraint condition?
I need to reject records being inserted to my Induction_Info table where the bundle does not exist in my Bundle table, but on only when Induction_Info.Project_Code = 'TEST'. Is this possible?
I've attempted this:
ALTER TABLE EXFC.INDUCTION_INFO ADD
CONSTRAINT chk_induction_info$bundle
CHECK (bundle in(select bundle from bundle)) ENABLE
VALIDATE
But when I attempt to compile I get the message:
ORA-02251: subquery not allowed here
I don't even know if what I'm attempting is possible. Can you help? I'd certainly appreciate any help. Thanks.