Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRIM commands ignored when applied to indexes?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00254070
Message ID:
00254089
Views:
17
>Hi All:
>
>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

You should only use TRIM in an index expression if you are concatenating 2 fields. Like Index on trim(FirstName) + LastName. Otherwise, TRIM is not needed. You should also check settings for SET EXACT, SET COLLATE [among others] because these are scoped to each datasession. See SET DATASESSION in VFP Help for all SETs that are scoped to the DS.

Alos, on character data, you may consider using the UPPER or LOWER function to make SEEKs and LOCATEs case insensitive. Of course the parameter you are pasing needs to be converted to UPPER or LOWER, depending on the index.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform