Re: Relation problem

From: Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl>
Date: 18 Jan 2001 16:12:07 GMT
Message-ID: <9474kn$41p$1_at_news.tue.nl>


Michel wrote:
> Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl> wrote in message
> news:946blu$hkt$1_at_news.tue.nl...
> > Michel wrote:
> > > Designing this large database where we store adresses as their
> > > own entity. i.e. an address exist by itself. We also have
> > > individuals AND organizations that can have have more than 1
> > > address. So far so good, created a link table were I wanted to
> > > use the primary key as individualID and AddressID.
> > >
> > > This would be great, but it's got to be an individual OR an
> > > organization, so I cant have referencial integrity enforced at
> > > the database level.
> >
> > Why not simply split the table Addresses in OrganizationAddresses
> > and IndividualAddresses? You can always define a view that takes
> > the union of these two tables if you need it.
>
> Because I need to keep a single table of address with no duplicates.
> We have regurlar updates for address validations, new addresses and
> so on.

Ah, Ok. Then there is probably no way you can solve this by choosing the right tables and you will have to resort to something like triggers to guard this constraint.

-- 
  Jan Hidders
Received on Thu Jan 18 2001 - 17:12:07 CET

Original text of this message