cancel
Showing results for 
Search instead for 
Did you mean: 

Using where clause dynamic in CDS

03-18-2021 6:16 AM
471 views 0 comments
0 Likes
SAP Managed Tags
Subscribe

Good Day

I am creating CDS service with HANA DB.

The service provides SELECT query.

The Query needs two tables(1:n relation Table. I call it master/detail relation)

I just want to select MASTER Table. But want to using DETAIL table's column value.

The query in DBMS like below

select A.*

from MASTER A

where exists (select 1 from DETAIL where DETAIL.col in ('a', 'b', ...))

- in case there are no values in clause, the query must be below

select A.*

from MASTER A

- in case there are at least one value in clause, the query must be below

select A.*

from MASTER A

where exists (select 1 from DETAIL where DETAIL.col in ('a', 'b', ...))

- if call the service, the parameter is just string or array?

If possible, I want to get or see just sample service codes.

Thanks

0 Likes

Accepted Solutions (0)

Answers (0)