Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can ALLTRIM on an index field cause problems?
Message
De
06/03/2001 13:36:01
 
 
À
06/03/2001 12:22:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00482253
Message ID:
00482360
Vues:
10
>Hi Brenda.
>
>>I read that ALLTRIM on index fields can cause data corruption problems. Is this true? I have ALLTRIMs in many of my applications indexes. And some of the indexes use LTRIM RTRIM to accomplish the same thing. Is this better procedure: INDEX ON LTRIM(RTRIM(CODE_ID))+LTRIM(RTRIM(CODE))TAG ID_CODE
>
>To add to what the others said, I accomplish the same thing by padding the entire expression; for example, INDEX ON PADR(ALLTRIM(CODE_ID) + ALLTRIM(CODE), LEN(CODE_ID + CODE)) TAG ID_CODE. That way, you get the advantage of trimmed strings in the concatenated result but the entire string is padded to the maximum length so you have a consistent key length.
>
>Doug
Am I missing something here. Don't all agree at once yet. Wouldn't trimming and concatentation in this way lead to potential errors. For example,
First case-
CODE_ID = 'ABC '
CODE = 'DEF '
Second case-
CODE_ID = 'ABCD '
CODE = 'EF '
Won't the index expression of these two cases be the same?
Maybe that's the desired result.
My preference is to index the fields as they are CODE_ID + CODE
and manipulate the expressions while searching the index via SEEK, INDEXSEEK or some other command/function.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform