Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Views and Indexes
Message
 
À
11/03/1998 15:40:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00083982
Message ID:
00084044
Vues:
27
>>>Is there a way to index a view so I can do a seek?
>>
>>Trish, just SELECT you view and index it as if it is a table.
>
>But I have to write to to it and want to use the buffering. Plus, if we upgrade to SQL server we have been trying to just use views.
Trish,

You cannindex a view with the INDEX ON command but you need to change the buffering while you create the index. Views, by default, are opened in Optimistic Table buffering (mode 5). Table buffering will not allow the INDEX ON comamnd. The suggestion I have for you is to pot the view in your form's DE with the NODATAONLOAD property set to .T.. The in the form's Init put this code;


SELECT TheView
* Set buffering to row
CURSORSETPROP("BUFFERING",3,"TheView")
* Create your indexes
INDEX ON ...
INDEX ON ...
* Set buffering back to table
CURSORSETPROP("BUFFERING",5,"TheView")
* Get the data for the view
REQUERY("TheView")
<\PRE>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform