Subject | Re: [ib-support] Self-referential constraints |
---|---|
Author | Helen Borrie |
Post date | 2002-10-08T04:00:13Z |
At 01:11 PM 08-10-02 +0930, you wrote:
structure, I don't know a way to use formal REFERENCES constraints to
enforce it. I almost always make 0 or -1 the root of such a structure
(enforced by triggers, not default values). When I have special need for a
NULL root, I don't use a formal FK but contrive it by hand with triggers.
Helen
>How to set up a self-referential constraint forIf you want to have NULL representing the "root" of your self-referencing
>
> PersonTable(Child INTEGER NOT NULL, Parent INTEGER, Name VARCHAR(20)
> NOT NULL)
>
>that forces Parent to exist as a Child unless Parent is NULL?
structure, I don't know a way to use formal REFERENCES constraints to
enforce it. I almost always make 0 or -1 the root of such a structure
(enforced by triggers, not default values). When I have special need for a
NULL root, I don't use a formal FK but contrive it by hand with triggers.
Helen