on 01-31-2005 7:07 AM
I have a Database-field (CHAR60) that contains text with upper and lower case letters. In my application, the user can search for entries in the DB table using this field, which leads to an SQL statement like this:
SELECT * FROM table WHERE field LIKE pattern INTO...
My question:
If I search for "abc", i won't find entries with "aBc". Can I do a case-insensitive search with SELECT and LIKE?
Hello Daniel,
What is the domain(CHAR60) for the field that you are searching for?
The domain has an attribute called <i>Lowercase</i>, and it is my understanding that so long as this is checked, the data will be stored in the database exactly like it was entered on the screen (case-sensitive).
If thst is the case with your domain, then I guess you would have to make do with something like:
SELECT *
FROM table.
TRANSLATE : TABLE-FIELD TO UPPERCASE,
PATTERN TO UPPERCASE.
IF TABLE-FIELD CS PATTERN.
* Do your processing here...or fill the internal table
ENDIF.
ENDSELECT.
I know this code has been a bit crude, but this is the essence.
Regards,
Anand Mandalika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.