Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set
Message
De
25/06/2002 21:34:09
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00671823
Message ID:
00672274
Vues:
11
>>I think you should use a view (vista), instead of a regular cursor. Just create the view from the database container. The view, I believe, can be based on free tables.
>>
>>The view is similar to a cursor, but Visual FoxPro can update the underlying tables (las tablas subyacentes) automatically. Normally you would use it with buffering (just as you would with any regular table), and save changes with TableUpdate() (or undo changes with TableRevert()).
>>
>>HTH, Hilmar.
>
>Hi again, Hilmar. I've never used views on my applications,I prefer to populate a cursor with the data I want. Please don't ask me why :). But I'm definitely decided to give'em a try. How is their performance on large databases? I don't wanna have any bottleneck.
>
>Enmanuel

A view is just like a cursor in this sense. Data selection should be as fast as the corresponding cursor.

Usually you would use a parameterized query for selecting a small subset of a large table. For instance, "Client = ?vClient". Note the question mark - it is customary - and legal - to include a question mark here. This indicates to VFP that, if the variable doesn't exist, the user will be shown a dialog (but you want to avoid this at all costs). Some frameworks parse for the question mark, so I recommend to include it. As a matter of fact, I never tried to define a parameterized view without it.

The view will simply simplify some programming aspects. Specifically, VFP takes over more of your work. You issue TableUpdate(), and VFP takes care of finding the records to update (or creating new records) in the original table.

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform