Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bizobjs and data updates
Message
De
18/09/2001 23:19:13
 
 
À
18/09/2001 11:59:23
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00557928
Message ID:
00558174
Vues:
13
>I'm using BizObjs and BizRules objects when performing any updates to a table. However, what about situations when your updating specified fields for sets of records in SQL tables?
>
>My real world example is stock splits. I have to adjust the price along with a number of other fields in an SQL table by the split factor. My business rules are mirrored in both the business rules object and as SQL constraints.
>
>I'm thinking I should just run a T-SQL statement from a method within my BizObj such as : UPDATE MyTable SET Price=Price/Split WHERE Ticker = 'ABC'
>
>It would be so much faster, and so much less network traffic then retreiving and processing each record through my BizRules object.
>
>How do you handle these situations?
>
>TIA,
>Anthony

Anthony,

The business rules object is really intended for validating data before sending any updates to the backend. Your example is classic example of when to use stored procedures v. updating a view directly. In your bizobj, you could have a method that calls your stored procedure, or you could accomplish the same thing with sql passthrough. Another method would be to create a view that fetches all the records that match your ticker, and update the values in the view.

The fastest method is to call a stored procedure. If this is part of "data maintenance" and not something a user would input on a regular basis, I would definately use a stored procedure. It's fast and transaction handling is implicit in the procedure.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform