cancel
Showing results for 
Search instead for 
Did you mean: 

Create an alias/synonym for STRING_AGG aggregate function in HANA

02-07-2023 4:57 PM
bdeboer Explorer
1974 views 5 comments
0 Likes
SAP Managed Tags
Subscribe

I am facing an issue with the aggregate function "STRING_AGG" in CDS, which is not supported in both HANA and SQLite. As a solution I'm currently maintaining two sets of CDS files to handle STRING_AGG / GROUP_CONCAT depending on the database. But this is starting to get diffucult to maintain. I'm hoping there is a better way.

I've tried to creating a custom GROUP_CONCAT.hdbfunction which simply calls STRING_AGG. But it seems these functions can't work as aggregate functions in HANA.

I also tried to create a synonym for STRING_AGG. I'm not sure if it's possible. I cannot seem to find STRING_AGG in the system views.

My next plan would be to create a script that automatically generates the set for HANA. Performing a simple replace GROUP_CONCAT -> STRING_AGG. But this doesn't feel optimal either.

Is there a better solution for handling the "STRING_AGG" aggregate function in CDS for HANA and SQLite without maintaining separate sets of CDS files?

0 Likes

Accepted Solutions (0)

Answers (0)