Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Index tag on two integ fields
Message
De
23/09/2017 01:23:07
 
 
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:
01654507
Vues:
61
>>>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.
>
>Thank you. The speed is not important for this. I am just converting some .DBFs to SQL server.

In that case the order shouldn't be important at all. On SQL server there is no such thing as "natural order" of the records anyway.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform