cancel
Showing results for 
Search instead for 
Did you mean: 

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

daniel_humberg
Contributor
0 Kudos

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?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Daniel,

You might want to refer this post as the query is similar.

So sorry about that. Thanks for letting me know Poornanand.

<u>

<b>

Regards,

Subramanian V.

Message was edited by: Subramanian Venkateswaran

Former Member
0 Kudos

Hi Subramaniam,

Where's the post ? The link takes us to the Home Page of ABAP Programming.:-)

Regards,

Anand Mandalika.