Skip to Content
author's profile photo Former Member
Former Member

Can we get the exact data in db irrespective of case sensitivity?

Hi All

I am newbie in World of HANA. Needed one help regarding the case insensitivity issue with data involved, I have the following requirement:-

My query is not retrieving the records.Please provide a solution to this:(

data.png (4.5 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jul 13, 2016 at 01:02 PM

    Hi Crystal,

    You could use LIKE_REGEXPR to get regular expressions and case insensitive matching.

    Regards

    Joerg

    create column table mytab ( name nvarchar(100) );

    insert into mytab values ('George Grint');

    SELECT * FROM mytab WHERE name LIKE_REGEXPR 'George.*'; -- case sensitive

    SELECT * FROM mytab WHERE name LIKE_REGEXPR 'GEORGE.*'; -- case sensitive

    SELECT * FROM mytab WHERE name LIKE_REGEXPR 'GEORGE.*' flag 'i'; -- case insensitive

    drop table mytab;

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 13, 2016 at 11:20 AM

    Hello Crystal,

    there are several discussions already available covering this topic. For instance which describes different solutions.

    If possible for you I would use the CONTAINS Predicate like e.g.

    SELECT * FROM <table_name> WHERE CONTAINS("<column_name>", 'George');

    Regards,

    Florian

    PS: That you expect 'David Grint' as output for name 'David Cruise' is an error, isn't it?

    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.