cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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:(

Accepted Solutions (1)

Accepted Solutions (1)

JoergM
Advisor
Advisor
0 Kudos

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;

Former Member
0 Kudos

Hi Joerg

       Thanks a lot for the response.The query posted worked for meThank you All

Thanks

Regards

Answers (1)

Answers (1)

pfefferf
Active Contributor
0 Kudos

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?

Former Member
0 Kudos

Hi Florian

        Yep that was a typo error, that should be Cruise!!!

Thanks

Regards

Former Member
0 Kudos

Hi Florian

      I was wondering about:-Is there any way to turn off the settings of case sensitivity in HANA?

Thanks

Regards

pfefferf
Active Contributor
0 Kudos

Globally not to my knowledge.

Message was edited by: Florian Pfeffer