Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memo search
Message
From
20/10/2005 12:14:48
 
 
To
20/10/2005 12:03:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01060733
Message ID:
01060765
Views:
8
>>>>I have a customer that would like for me to search memo field for specific words and update another table based on the results. For example if I search for "Ford" they only want to update for items that contain "Ford" and not things such as Bradford, Kingsford and so on. What's the best way for me to do this?
>>>
>>>Here something that should works all the way (I think)
>>>
>>>SELECT * FROM YourTable;
>>>       WHERE MyMemoField LIKE '% Ford %' OR;  && Note the spaces around Ford
>>>             MyMemoField LIKE 'Ford %'   OR;  && Memo begins with Ford
>>>             MyMemoField LIKE '% Ford';       && Memo ends with Ford
>>>INTO CURSOR cTest
>>>
>>>but the speed will be deadly :o)
>>
>>if you doesn't go to the mountain,
>>then you make to walk the mountain:
>>
>>SELECT * FROM YourTable;
>>       WHERE ' '+MyMemoField+' ' LIKE '% Ford %';  && Note the spaces around Ford
>>INTO CURSOR cTest
>>
>This won't work in the following example: let's say the memo contains:
>"Our oldest Ford; don't sell it."
>
>So the first suggestion of Borislav should do it, although allowing for cups of coffee during search :-)
>
>If the content of the memo is absolutely not predictable, so for example the character before Ford could be a tab and behind it a '-', just do the select for ...LIKE '%Ford%' and after that a SCAN which lexically analyzes the situation, allowing for space-like characters (CR,NL,TAB etc) and signs (.,?!-+=;:'" etc) to precede or follow the word "Ford".
>
>Lennert
>
>Lennert

I have simplified BB select only.
The a true solution consists of indexing the words of the field memo
with a hash technique.
Previous
Reply
Map
View

Click here to load this message in the networking platform