I want to search all the customers which contains 'Kan' in any field of the customer table. What should I do?
Asked
Active
Viewed 49 times
-1
-
1Before you spend too much time one it you should go back to whoever gave you this requirement and inform them that it is going to be incredibly slow to execute. You are going to have to read every record and perform comparisons on every character field. It is like having to read the entire phone book to find anyone who has "kan" somewhere in their name. There are no shortcuts and there is no pixie dust that will make this fast. – Tom Bascom Apr 30 '20 at 16:08
1 Answers
5
Unless you are maintaining an “index” field yourself in which you concatenate all character fields yourself, you’ll have to do it like this:
FOR EACH Customer WHERE Customer.NAME MATCHES “*Kan*”
OR Customer.Address MATCHES “*Kan*”
OR Customer.Address2 MATCHES “*Kan*”:

Mike Fechner
- 6,627
- 15
- 17
-
1You can also look at the CONTAINS operator and word indexes ... https://docs.progress.com/bundle/openedge-api-reference/page/The-CONTAINS-operator.html – nwahmaet Apr 30 '20 at 13:59