Using a function in a check constraint
6816May 18 2004 — edited May 20 2004Hi,
I created a domain table(id, code, domain_code, description) and foreign keys to this table. To ensure that a valid domain is put in the column I created a function that returns a boolean and has two parameters (id and domain_code). It returns true if the id and domain belong together.
I want to know if it is possible to create a check constraint which validates the data in the refering table with the data in the domain table.
Does anyone know if this is possible? Or do I have to use a db-trigger?
Regards,
Romano