Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: ARRAY_AGG function is not working with UNNEST function in SAP HANA SQL Procedure?

$
0
0

Hello Ramana,

 

ARRAY_AGG does not work as you assume. It does not append values of a table column to an array so that in a loop the array contains more and more values. The function only sets the values of the table column in the array (and everything already available in the array is overwritten).

 

As your coding is a little bit confusing to me (e.g. no access to cursor row, no setting of l_entries which steers loop, ... -> but maybe you have removed some coding for the post), there is no real recommendation possible, cause it is not clear what you wanna reach.

 

From what I understand and what I would assume what you wanna reach, I would say that you not need at all arrays and that you can reach your goal by just using SQL (e.g. by a Union between OT_HIERARCHY and the select on HRP1001. Or even more simpler with a join between HRP1000 and HRP1001 (e.g with using Window functions if you wanna do a restriction on a specific number of entries per "header object").

 

Regards,

Florian


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>