Skip to Content
0

SQL and CONTAINS

Oct 22, 2016 at 02:20 PM

297

avatar image

Hi Experts,

I want to use the fuzzy search in SQL Select statements on standard SAP tables (e.g. PRPS) with the CONTAINS predicate. In OPEN SQL this does not work. So I use native SQL an our HANA Database.

But whenever I use the contains predicate (e.g. "where contains(post1, 'e', FUZZY(0.1)") I get no rows returned. Without the contains predicate the select statement returns the correct rows.

Any hints?

Regards

Rolf

SQL
10 |10000 characters needed characters left characters exceeded

I've modified your subject to remove the ABAP as it isn't really an ABAP question - it's native SQL.

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Rolf Gadorosi Oct 26, 2016 at 06:38 AM
0

To whom it may concern:

Masking the search string with wildcards works fine:

where contains(post1, '%e%', FUZZY(0.1)

Regards

Rolf

Show 2 Share
10 |10000 characters needed characters left characters exceeded

If this is answered then please close your question (see Actions button). Otherwise it still shows up on the list of unanswered questions.

Thank you.

0

The question is not answered. The fuzzy option does not work. Any hints welcome.

Regards

Rolf

0
Jelena Perfiljeva
Nov 15, 2016 at 09:48 PM
0

In ABAP / Open SQL even before HANA we can use an asterisk as a wildcard. So if I wanted to find a string that contained 'e' then I'd put '*e*' in the selection option. Percentage sign is used with LIKE, if memory serves.

But wildcards already are "fuzzy search", so I don't really understand what you are trying to achieve with such combination. You might want to clarify.

Share
10 |10000 characters needed characters left characters exceeded
Matthew Billingham
Nov 16, 2016 at 07:40 AM
0

Have you tried the SQL from HANA studio in the console? Does it work there? If it does, then the problem lies in the way that you're constructing your SQL within ABAP.

If it doesn't, then we know it's an SQL syntax issue. (And this is what I expect, but it is worth checking).

Share
10 |10000 characters needed characters left characters exceeded