Skip to Content
avatar image
Former Member

STRING_AGG exceeds maximum length

Hello,

I am trying to use STRING_AGG in my sql statement. As my result set is very large, I am getting the following error.

Could not execute 'SELECT "TDNAME", LENGTH (STRING_AGG("TDLINE",'.')) as length1 FROM "schema name"."table name" GROUP BY TDNAME ...' in 3.572 seconds . SAP DBTech JDBC: [384]: string is too long: aggregated string length exceeds maximum length: 8388607 at function aggr::string_agg() (at pos 35)

I would like to only include first 8000000 in length or first 1000 rows and trim the remaining length of the string from this function.

Alternatively I need to find the length of each of the column in all the rows per group and sum it up which is a time consuming activity.

Is there any way to achieve this? Any suggestions would be very helpful

Thanks and Regards,

Suryakiran.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers