Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Indexes to VFP tables programmatically
Message
De
16/07/2002 16:31:06
 
 
À
16/07/2002 16:20:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00679363
Message ID:
00679374
Vues:
24
Pick an expression, any expression will do.

Indices accept any type of information so long as the data types being joined are the same.

e.g.

INDEX ON firstname TAG firstname
INDEX ON lname + fname TAG name
INDEX ON STR(NAME_ID) + lname TAG weird
INDEX ON DTOS(datefield) TAG datefield
INDEX ON TTOC(datetimefield) TAG dtfield


I think you get the idea. You choose a function and it can become part of your INDEX expression. Notice I used DTOS() for date expressions.

I got one for you, you want to reverse the order of the date in the index. There are two ways to achieve this.

INDEX ON 99999999 - VAL(DTOS(datefield)) TAG datefield

OR

INDEX ON DTOS(datefield) TAG datefield
SET ORDER TO datefield DESCENDING


Of course the application of the index will determine which one you would choose. The first one has a disadvantage of being too complex to use for Rushmore Optimization.

Before going to far creating wild indices, look at the Rushmore Optimization sections of Help.
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform