Re: Foreign Key Question
From: Pablo Sanchez <pablo_at_dev.null>
Date: Tue, 5 Feb 2002 16:25:56 -0700
Message-ID: <dSZ78.77$Qf2.84900_at_news.uswest.net>
Date: Tue, 5 Feb 2002 16:25:56 -0700
Message-ID: <dSZ78.77$Qf2.84900_at_news.uswest.net>
"Chuck B" <chuck_jen49_at_yahoo.com> wrote in message
news:b1245bc4.0201222143.6716890e_at_posting.google.com...
> That's what I was thinking.
> Thanks
> >
> > A foreign key can not reference part of a primary key.
> > Check constraints do not allow selects.
> > You'll need a trigger.
> >
You might elect to go the route of creating a 'surrogate' key on your table:
table_foo
id number(16)
a
b
c
...
You can use 'id' as a unique identifier and use SEQUENCEs to populate it. Now you'll be able to setup contraints etc. I think you'll find that you're job will be easier. You can still create a UNIQUE index on your 'natural key'
-- Pablo Sanchez, High-Performance Database Engineering www.hpdbe.com Independent Contractor, available for short-term and long-term contractsReceived on Wed Feb 06 2002 - 00:25:56 CET