Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Integrity Question
Message
De
04/08/1998 15:49:35
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00123680
Message ID:
00123906
Vues:
15
>Bill,
>
>Two ideas come to mind, 1 your data is not in thrid normal form if you are storing the result of a calculation. That means it is not unusual to require the extra TableUpdate. 2 By violating third normal form you have created a sequence dependency on the tableupdates, the child must always be done first and the parent must always be done if the child was done.
>
>When we choose to break a normalization rule we often pay with more complex code to handle integrity issues. The real question here is, "Is it better to store the total and have complex integrity code, or not store the total and have simple integrity code."

Generally you're right, and I often wish I could follow the rule, but -
many times I have such a situation that I can't simply recalculate the sums, because some additional things are done once per parent record. For instance, in a classical invoice example, I can't just total qty*price, because there's some transport cost added (without quantity), among other things, and it appears only once per invoice. Another matter is manual rounding of the total (some customers insist on that). Our solution was always to pull any calculation (and prompt for additional ammounts) in an additional form which pops up whenever user decides that a document is finished, i.e. no more line items to add. This also means that the form is one and only way to approach the child and parent data - no grids etc.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform