Constraint forcing at least one child to exist and check constraint using table values
1. Can I add a value validation constraint with record selection? I researched how you can have a constraint to only allow certain "hard coded values" but can't find an example based on table values like below. I did see that sub queries are not allowed so I am guessing that is why, but I certainly wouldn’t want to hard code 100s of values.
ALTER TABLE SCHEMA.PATIENT ADD
CONSTRAINT PATIENT_C01
CHECK (pat_field IN (SELECT table_id FROM lookup_table where table_type = 'values_1'))