Re: Composite keys

[prev] [thread] [next] [Date index for 2005/05/04]

From: Kevin Old
Subject: Re: Composite keys
Date: 20:59 on 04 May 2005
Hi Perrin,

On 5/4/05, Perrin Harkins <perrin@xxxx.xxx> wrote:
> On Wed, 2005-05-04 at 15:53 -0400, Kevin Old wrote:
> > I'd like to create a has_a() statement on EmpCustXref for customernum
> > AND storenum against CustStoreDetails.
>=20
> Wouldn't that be has_many()?  There can be more than one
> CustStoreDetails for each storenum, right?
=20
Well, I'm not sure.  There is a constraint on the Employee Customer
Xref table against the Customer Store Details Table:

alter table [employee customer xref]
add constraint [fk_employee customer xref_customer store details table]
foreign key (customernum, storenum) references [customer store details tabl=
e]
(customernum, storenum)

Basically, this ensures that the Customer and Store exist on the
Customer Store Details Table before allowing a record (which is linked
to it via the foreign key) to be inserted into Employee Customer Xref.

I guess I'm not exactly sure how I need to "link" these two tables up.

Thanks for your help,
Kevin
--=20
Kevin Old
kevinold@xxxxx.xxx

Composite keys
Kevin Old 19:53 on 04 May 2005

Re: Composite keys
Perrin Harkins 20:24 on 04 May 2005

Re: Composite keys
Kevin Old 20:59 on 04 May 2005

Re: Composite keys
Perrin Harkins 21:10 on 04 May 2005

Re: Composite keys
Kevin Old 21:45 on 04 May 2005

Generated at 16:36 on 28 Jul 2005 by mariachi v0.52