Follow up question to previous thread on VFP 5.0a query questions 
Author Message
 Follow up question to previous thread on VFP 5.0a query questions


Quote:

> Is there not a way to make the
> queries totally case insensitve and just match on the characters?

Yes there is.  SET COLLATE TO 'General'
However, for rushmore optimization to kick in you have to have an index
that was also created with SET COLLATE TO 'general' in effect. And the
caseinsensitivity only applies to = not to LIKE comparisons. You'd
better stick with UPPER and SET COLL TO 'machine'

-Anders

--

10/25/97 16:48
---------
Using: OUI 1.8 Beta 6 from http://www.*-*-*.com/



Wed, 12 Apr 2000 03:00:00 GMT  
 Follow up question to previous thread on VFP 5.0a query questions

Hi

Sorry to be a pain I have almost got the idea now but still  have a
couple more questions.

Previously I was told that to perform a search for substrings inside
strings the following would work.

"%string%"

How would I apply this principle to the following:

lcWhereClause = [WHERE &lcSearchField = UPPER(M.lcSearchString)]

SELECT * FROM invt;
        &lcWhereClause INTO CURSOR QueryResult

The problems I have are how to attach the % characters to the
M.lcSearchString variable and inserting a LIKE into the statement so
that it works (everytime I tried to use a like it returned no records
found)

Also I have a general question on making the searches case insensitive
for example if I used :

lcWhereClause = [WHERE &lcSearchField = (M.lcSearchString)]

and was searching for "Screw" then the search only returned the exact
match (case wise) so{*filter*}or{*filter*}were ignored.

Likewise f I used

lcWhereClause = [WHERE &lcSearchField = UPPER (M.lcSearchString)]

Then only{*filter*}returned records. Is there not a way to make the
queries totally case insensitve and just match on the characters?

Once again thank you for your time and patience.

Nick Steele



Wed, 12 Apr 2000 03:00:00 GMT  
 Follow up question to previous thread on VFP 5.0a query questions

NS>Hi

NS>Sorry to be a pain I have almost got the idea now but still  have a
NS>couple more questions.

NS>Previously I was told that to perform a search for substrings inside
NS>strings the following would work.

NS>"%string%"

NS>How would I apply this principle to the following:

NS>lcWhereClause = [WHERE &lcSearchField = UPPER(M.lcSearchString)]

NS>SELECT * FROM invt;
NS> &lcWhereClause INTO CURSOR QueryResult

NS>The problems I have are how to attach the % characters to the
NS>M.lcSearchString variable and inserting a LIKE into the statement so
NS>that it works (everytime I tried to use a like it returned no records
NS>found)

Try

lcWhereClause = "WHERE "+lcSearchField+ " LIKE '%"+
UPPER(M.lcSearchString)+"%'"

NS>Also I have a general question on making the searches case
NS>insensitive for example if I used :

NS>lcWhereClause = [WHERE &lcSearchField = (M.lcSearchString)]

NS>and was searching for "Screw" then the search only returned the exact
NS>match (case wise) so{*filter*}or{*filter*}were ignored.

NS>Likewise f I used

NS>lcWhereClause = [WHERE &lcSearchField = UPPER (M.lcSearchString)]

NS>Then only{*filter*}returned records. Is there not a way to make the
NS>queries totally case insensitve and just match on the characters?

Use UPPER or LOWER on both halves of the expression.

lcWhereClause = [WHERE UPPER(&lcSearchField) = UPPER (M.lcSearchString)]

NS>Once again thank you for your time and patience.

NS>Nick Steele


-----------------------------------------------------------------------------

This message was processed by NetXpress from Merlin Systems Inc.
-----------------------------------------------------------------------------



Thu, 13 Apr 2000 02:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Follow up question to previous thread on VFP 5.0a query questions

2. Question on queries in VFP 5.0a

3. Question about VFP 5.0 and VFP 5.0a

4. To 5.0a or not to 5.0a, that's the question

5. Interesting Problem (continuation from my previous question)

6. ComboBox -Previous Data Question

7. A few Questions on VFP 5.0a

8. VFP 5.0a Questions

9. VFP 5.0a: General Questions

10. VFP 5.0a - one more resize related question

11. DragIcon Question VFP 5.0a

12. Questions regarding Multi-threading server (dll)

 

 
Powered by phpBB® Forum Software