Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRIM commands ignored when applied to indexes?
Message
From
16/08/1999 12:29:57
 
 
To
16/08/1999 12:18:09
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00254070
Message ID:
00254109
Views:
29
Hi Charlie,

Hmmmm....could be. I've never had occasion to use either in an index expression. Why would you want to?

Jim always finds stuff like that :-)



>The ALLTRIM(), TRIM is ignored in the index, as I think J. Booth pointed out to me some years ago.
>If you SET EXACT ON and SEEK ("Koziol") with an INDEX ON TRIM(Name), you get no match.
>If you SET EXACT ON or OFF and have an index on ALLTRIM(Name) and do a
>SEEK(PADR("Koziol",x)), assuming I added the right number of spaces, it IS found.
>Don't ALLTRIM(), TRIM in INDEX expressions. It's pointless.
>
>>Hi Charlie ---
>>
>>No they are not; something else must be going on. For example, if I have an index on TRIM(lastname) and then SEEK "Koziol" there shouldn't be a problem. Perhaps you are using UPPER or LOWER in the index expression or in the SEEK expression?
>>
>>
>>>
>>>If I have an index on some field and the expression I'm searching for using SEEK() has leading or trailing blanks, I don't get a match. If I try an alltrim on the search expression and the index key, I still don't get a match. I appears that TRIM commands are ignored in index expressions.
>>>
>>>Charlie
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform