Subject Re: [ib-support] Help: Domain and referential integrity constraint
Author Helen Borrie
At 07:26 AM 14/01/2003 +0000, you wrote:
>Dear all,
>
>
>The Data Def guide say:
>"You cannot apply referential integrity constraints to a domain."
>
>But I have the following worked okay:
>ALTER TABLE SLAVE1 ADD CONSTRAINT FK_SLAVE1_MASTER1
> FOREIGN KEY (MASTER_ID) REFERENCES MASTER1 (ID)
>...
>MASTER1.ID and SLAVE1.MASTER_ID are of a domain type.
>
>I am using FB 1.0. Am I misunderstanding the guide?

Possibly yes you are.. The passage you have quoted does NOT say "You
cannot apply referential integrity constraints to a column which is defined
by a domain".

Many of us use domains to define ALL columns. It would be absurd to have a
restriction the way you interpreted it. :-)

What you CANNOT do is define a domain which places some kind of
universal ref. integrity constraint on any column which is defined by
it...so you **can't** have something like
CREATE DOMAIN CHILD AS INTEGER [NOT NULL]
FOREIGN KEY (what_would_you_put_here?) REFERENCES PARENT;


heLen