Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create composite index on Integer fields?
Message
De
02/12/1997 08:12:38
 
 
À
02/12/1997 02:16:09
Shihchau Tai
Apic Systems Pte Ltd
Singapore, Singapour
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00063211
Message ID:
00063233
Vues:
41
>I have a composite key that consists of two integer fields. How do I create the composite key?
>
>If I do STR(iKey1)+STR(iKey2), I will get a long string, right? I can't alltrim them because that will make the composite index wrong, right? Do I have to fix the number of characters for each field of the composite key?

STR(iKey1) + STR(iKey2) is the way to go. Don't do an ALLTRIM since iKey1 = 11, iKey2 = 1 will have the same index value as iKey1 = 1, iKey2 = 11. By default, STR will create a 10 character field. If your value are less than that, specifying a length will reduce the size of the index. If it's greater, you will have to specify the lenght, otherwise the index will be truncated.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform