Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ALLTRIM in indexes
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00138923
Message ID:
00139485
Vues:
40
>>One more thing: usually there is the need to use alltrim() when concatenating several fields.
>
>I'm assuming you meant "there is no need."
>
>>>Using the "-" (minus) operator to concatenate strings moves all the blanks to the end of the string without changing the total length. Usually this is enough instead of using alltrim on a whole expression.
>
>For example, for a first and last name, you definitely don't want to use AllTrim():
>
> JAMES TIM
> JAMESON ALAN
>
>If you AllTrim(), you end up with
>
> JAMESTIM
> JAMESONALAN
>
>which won't give you the correct sort order (as we usually want it).

No, ALLTRIM() doesn't touch blanks in the middle, and sometimes it might be used if user wants to have sorting by last (w/out trailing spaces)+first name. The only thing is paying attention to SQL_SELECT Where clauses which should correspond to index expressions.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform