Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of SQL not like operator in CQL #786

Open
cwendeln opened this issue Aug 26, 2024 · 1 comment
Open

Support of SQL not like operator in CQL #786

cwendeln opened this issue Aug 26, 2024 · 1 comment
Labels
author action bug Something isn't working

Comments

@cwendeln
Copy link

Hello,

I am trying to await a select statement that uses the SQL syntax of "not like" on a HANA database. However, I found no description in the official CAP documentation or in examples. The service always returns a SQL syntax error.

Here is an example:

await SELECT.from('Foo') .where ({ name: { notLike:'%foo%'}, and: {
kind: { in: kinds },
or: { ratio: { between: min, and: max },
or: { stock: { '>=': stock } }
}
}})

I have tried different wordings and object structures such as "not like" and "notLike". I always get the sql syntax error.

These are the important dependencies:
"@cap-js/hana": "^1",
"@sap-cloud-sdk/openapi": "^3.16.0",
"@sap/cds": "^8.0.4",

Does anyone know how to use the cql syntax together with not like? It is supported for CAP?

Kind regards.

@cwendeln cwendeln added the bug Something isn't working label Aug 26, 2024
@johannes-vogel
Copy link
Contributor

Hi,

did you try the alternating string/value syntax?

await SELECT.from('Foo') .where (
  'name not like', '%foo%', 'and kind in', kinds,
  'or ratio between', min, 'and', max, 'or stock >=', stock
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author action bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants