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
2,672

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?

View Entire Topic
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!

David21
Explorer
0 Kudos

when using the contains function it works fine with one column but when i use multiple columns it gives me an error. This is the statement I am using:

query = cds.parse.cql(`SELECT * from Dummy WHERE contains((firstName,lastName), '${req.query.SELECT.search[0].val}')`);
Any ideas why it's giving an error ?