Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Index tag on two integ fields
Message
De
22/09/2017 20:06:53
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01654503
Message ID:
01654504
Vues:
56
>Hi,
>
>My table has two Int fields. I want to create an index tag so that I can use SEEK() with two Int values.
>Example:
>table has fields FLD1 Int, FLD2 Int.
>Two variables iVar1 and iVar2
>
>
>if seek( ..... )
>
>endif
>
>
>what would the the expression?
>
>index on ....    FLD1 ..... FLD2 ... TAG tagName
>
You could convert to CHAR and concatenate e.g.
INDEX ON STR( Fld1 ) + STR( Fld2 ) ...
but if you do that you'd need to SEEK on STR( Fld1 ) + STR( Fld2 ).

I'd be inclined to just index the columns individually, to separate tags, then use LOCATE:
LOCATE FOR Fld1 = iVar1 AND Fld2 = iVar2
The latter approach should be fully Rushmore optimizable. I don't know whether the first one would be faster or slower.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform