Re: Heirarchical Data Structures. MS Access. Together?

From: Lennart Jonsson <>
Date: 28 Jul 2003 12:46:26 -0700
Message-ID: <>

Heinz Huber <> wrote in message news:<3f252d63$0$48902$>...
> Lennart Jonsson wrote:
> > "Jace Harker" <> wrote in message news:<>...
> >
> >>"--CELKO--" <> wrote in message
> >>
> >
> >

> In the "pure" nested set, any parent has (right - left - 1) / 2 = number
> of children.
> Therefore it's easy to find out whether there are any children.

Yes, but it is still a bit of a hazzle to make the database understand when it should allow removal of an emp(?).


        emp CHAR(10) NOT NULL PRIMARY KEY,
        boss CHAR(10) NOT NULL,
        foreign key (boss) references OrgChart
                on delete restrict


should be enough to prevent the situation. Using nested set I assume one would have to use triggers or some similar construct to prevent the same thing. Perhaps one could express it using a check constraint? Without given it too much thought, I assume the constraint would contain a select statement, last time I checked DB2 did not support that, perhaps other databases does?


the above email no longer works due to spam.
Received on Mon Jul 28 2003 - 21:46:26 CEST

Original text of this message