cancel
Showing results for 
Search instead for 
Did you mean: 

What is the escape characters in HANA enterprise

Former Member
0 Kudos

I have to search a pattern in the string, however I am not getting desired result. Since in my pattern string I have a spacial characters like '_'.

Example: Pattern string is "MA_"  and it should return only "MA_%" string however query returning values like "MAN%" and "MA_%..

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

Hi All,

I found the escape characters in HANA.

If you want to search for the percentage sign (%) or underscore (_), you have to place an ESCAPE character in front. You can choose the ESCAPE character (with some restrictions).

LIKE '$%%' ESCAPE '$'

String starting with a percentage sign

LIKE '$_ _' ESCAPE '$'

String of two characters starting with an underscore

LIKE '%$%' ESCAPE '$'

String ending with a percentage sign

LIKE '%$%%' ESCAPE '$'

String containing a percentage sign

LIKE '%$_$%%' ESCAPE '$'

String containing an underscore followed by a percentage sign

LIKE '_ _ _ _ $%_ $ _%' ESCAPE '$'

“%“ on fifth and “_“ on seventh position.