CONSTRAINT TYPE_CD_OK CHECK (
EXISTS (SELECT 1 FROM XREF WHERE
XREF_GROUP = 'CUST_TYPE' AND
XREF_CD = TYPE_CD)
)
> There seems to be more serious problems.
> 1) The constraint is not only for the defined table but also for referenced
> tables in the subquery.
I don't understand what you mean -- the constraint only
constrains 1 column in one table...
> 2) There should be some standard lock mechanism for the range restricted
> by the subquery.
>
> I'm suspicious that we should/could implement constraints other than
> column constraints.
Again, I don't fully understand what you're saying; but I
have successfully implemented the constraint using a user
defined function.
Niall