Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table w/ two masters

Status
Not open for further replies.

JBirdieH

Technical User
May 22, 2001
37
US
In the case where you have for example a job table, a customer table, and a job/customer table, can referential integrity REALLY occur for both? It seems that the cascading does not work if the primary index doesn't begin with the same as the master table. In my case, the job as a master to job/customer works (cascades), but the customer to job/customer doesn't. It can keep out postings to job/customers that are not in customer, but it won't cascade a changed name. Any ideas?
 
JBirdieH,

I'm afraid RI, as defined by the BDE, only works through one level. Once you need to involve more than one table, it's difficult to use the basic RI capabilities provided by BDE. At that point, you pretty much need to code the business rules.

I usually separate the fields that are affected by RI into separate tables. For example, instead of including CustomerName in your Job table, I'd only include a customer ID. Since the ID of the customer should never change, changes to their name should never be an issue.

That is, you might select a different customer, but it should never affect the other contents of the Job table.

This is also one of the reasons why normalization is a very good exercise, for it can completely remove the need for a lot of jiggery pokery.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top