Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referential integrity which tier?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00288250
Message ID:
00294698
Vues:
33
>>RI is purely a function of relationships between entities in a database.. not the validity of the data held within the columns of non-RI columns.
>
>I disagree. Here is a biz rule that expresses referential integrity.
>
>"When a salesman is fired, move all of his customers to his manager". This prevents orphan customer records. This rule may change over time... such as
>"When a salesman is fired, move all of his customers to the newest salesperson".

Hi Evan,

I don't agree. RI is simply a state the data is in at this moment. The example is a business rule. It states what has to happen in a certain business situation. A by-product of the rule is what the data structure looks like so you can maintain RI and enforce the business rule.

What happens when the client says, "When a salesperson is fired, don't do anything with customer, just delete the salesperson". Your'e screwed if the customer table has a FK to the salesperson table. The moment a salesperson is deleted, you have an orphaned key.

In that situation you should add a link table between saleperson and customer. Now you can delete either at will without busting RI.
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform