cancel
Showing results for 
Search instead for 
Did you mean: 

HANA CONTAINS() predicate with multiple columns and multiple search criteria

BTP_Architect
Participant
0 Kudos

Hello,

I want to use contains() predicate with multiple search criteria.

But I have an error message saying: feature not supported: More than one CONTAINS with multiple columns

SELECT * FROM HANA_View
WHERE CONTAINS ( ( WERKS, MATNR, LANDX, MAKTX, NAME1, LAND1, LIFNR, IDNLF ) , '%Search1%') 
AND CONTAINS ( ( WERKS, MATNR, LANDX, MAKTX, NAME1, LAND1, LIFNR, IDNLF ) , '%Search2%') 

Could you please suggest how can I manage this requirement using one contains?

Accepted Solutions (0)

Answers (2)

Answers (2)

sourin_acharjee
Explorer
0 Kudos

Hi,

Please read into the documentation for CONTAINS function of HANA.

https://help.sap.com/docs/SAP_HANA_PLATFORM/691cb949c1034198800afde3e5be6570/1eb06e9afee74e7b8ebb117...

It clearly states that if you specify multiple CONTAINS conditions in WHERE, then only one of them can contain multiple columns!

pfefferf
Active Contributor
0 Kudos

As it is mentioned in the official documentation here this is a restriction.

I'm wondering why you are using an "AND" between the two where conditions. Should this be an "OR", if yes, than you can overcome that limitation by defining two similar selects, except the different where clause, and combine the result using a UNION.

Regards,
Florian

BTP_Architect
Participant
0 Kudos

Hello Florian,

The user will search for a material with two search criterea

Supposing that he wants materials code containing XX provided by vendor code containing YY

This have to be done by using AND in the select

My thinking was to use the INTERSECT of two select. What do you think?

Will it impact the performance?

Regards,

Moez.