cancel
Showing results for 
Search instead for 
Did you mean: 

STRING_AGG function in SAP HANA SQL Script

Former Member
0 Kudos

Hi,

We have HANA Revision 7.3.

STRING_AGG function seems to work when we just execute the query without assinging it to the value.

However as soon as we assign it to a value in a stored procedure or scripted Calcuation view, it fails.

Any ideas?

Thanks,

Hyun

 

Accepted Solutions (0)

Answers (2)

Answers (2)

ruediger_karl
Advisor
Advisor
0 Kudos

Hi,

please note that the STRING_AGG() function will not be supported earlier than SPS09. So, you found an undocumented feature. For now the feature is intended for SAP-internal usage only.

Regards, Ruediger

Former Member
0 Kudos

It seems STRING_AGG appeared in the latest SAP HANA SQL Reference. Expressions - SAP HANA SQL and System Views Reference - SAP Library

lbreddemann
Active Contributor
0 Kudos

Yes, as usual the documentation production is asynchronous with the actual product.

As long as product management, here represented by Ruediger doesn't release the feature officially it will stay in this half-supported state...

ruediger_karl
Advisor
Advisor
0 Kudos

Hi,

good news. The STRING_AGG() feature has been released earlier than expected. It is now officially supported - rev82 onwards.

Regards, Ruediger

aj_shaik
Explorer
0 Kudos

It will be a cool feature if STRING_AGG function is included in the list of

Semantic-> Columns panel -> Aggregate (list)  

Former Member
0 Kudos

That would be awesome!

+1 on this idea

former_member184969
Participant
0 Kudos

I Just putted it in the idea place. I think it's time to advertise 🙂

former_member184969
Participant
0 Kudos

Hi

The STRING_AGG functions seems a bit limited by the fact that the <delimiter> has to be a constant. Is there any plan to make it compliant with variables or functions(like CHAR(13) ?

Thanks.

Astrid_Gambill
Contributor
0 Kudos

Assuming you mean this - https://ideas.sap.com/D35515 - I just gave it a thumbs up.

lbreddemann
Active Contributor
0 Kudos

Hi Hyun

provide an reproducible example, please.

At least show us your coding and the error message.

Vague problem descriptions like this are hard to  work with and you don't want to make life hard for the ones that should help you, do you?

- Lars

Former Member
0 Kudos

Lars,

 

My apologies.

Here are 3 screen shots. Two are error message generated
when using STRING_AGG in a Calculation View, one is it running successfully in
SQL window when it is not assigned to output variable.

Thanks,

Hyun

lbreddemann
Active Contributor
0 Kudos

I cannot reproduce this with SPS 8.

In my example I set the Data Category of the calculation view to "empty" - so that no default aggregation is performed.

- Lars

lbreddemann
Active Contributor
0 Kudos

And of course, both output colums are attributes...