Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Search for * (star) character using CONTAINS()

$
0
0

Consider the following example:

 

create column table test_text (some_text text);

insert into test_text values ('ABC');
insert into test_text values ('*');

 

What I would like to get is only the second line, where text is '*'.

I tried:

-- Returns both rows
select *
from test_text where
CONTAINS(some_text,'*', EXACT);

-- Tried to escape the character, no result
select *
from test_text where
CONTAINS(some_text,'\*', EXACT);

 -- ASCII code for *, two rows again
select *
from test_text where
CONTAINS(some_text,char(42), EXACT);

 

As you see, I couldn't find a way in HANA to select a row where text contains star character.

Any solution you could suggest?


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>