Re: How to ensure data consistency?

From: Dan <guntermann_at_verizon.com>
Date: Wed, 08 Sep 2004 05:40:40 GMT
Message-ID: <sXw%c.6825$Q44.760_at_trnddc09>


"Dan" <guntermann_at_verizon.com> wrote in message news:vBw%c.6339$BQ4.1607_at_trnddc06...
>
> "ddtl" <fake_at_address.com> wrote in message
> news:3fsrj0lpe76pfvfjfe1ur2ubpb3hqu69fg_at_4ax.com...
> >
[snip]

[snip]
>

http://www.tomjewett.com/dbdesign/dbdesign.php?page=subclass.php&imgsize=largest
> >
> > it is impossible to enforce specialization constraints, and the only way
> to
> > ensure that every item with additional properties in the super-table has
> > an entry in the appropriate sub-table, is in the front end and not in a
> > database itself :-(.
> >
>
> Not necessarily true.
>
*Correction Follows*

> If the DBMS supports deferred constraint mechanisms, I circular Foreign
Key
> constraint relationship will work. [snip]

This won't work with multiple subtypes, either overlapping or disjoint; only mutual existence dependence relationships that are one to one. But triggers will do just fine. Front end enforcement is not always necessary.

> Look up Celko's recent posts in this newsgroup for a demonstration on how
to
> enforce mutual exclusivity in a generalization/specialization hierarchy or
> lattice. He uses a "discriminator" value appended to the natural key to
> form an alternative key. Each specialization table will reference this
key
> and should have a constraint limiting the value of the discrimator to a
> single value. His example relates to specializations on types of cars
(SUV,
> sedan, etc.).
>

The above still applies.

> Regards,
>
> Dan
>
>
Received on Wed Sep 08 2004 - 07:40:40 CEST

Original text of this message