Skip to Content

search * from t where a like b case-insensitive ?

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?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2005 at 07:27 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.