Skip to Main Content

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question.

Asked: December 14, 2017 - 9:24 am UTC

Last updated: December 15, 2017 - 7:33 am UTC

Version: 11g

Viewed 1000+ times

You Asked

I am using LISTAGG(card_name, ',') WITHIN GROUP(ORDER BY CardId) CARD_IDS to get the comma separate string.
Since there is more data and concatenate data legth exceeds 4000 CHAR due to which LISGADD is failing.

My need is to concate strings upto 4000 CHARS and rest can be ignore..
Is there any way to achieve this.
Could you please help in this case.

and Connor said...

In 12c, it is trivial with the ON OVERFLOW TRUNCATE clause.

Before then, use this technique as described by Stew Ashton

https://livesql.oracle.com/apex/livesql/file/content_EHSJPX1P6EEQ284YAX544WPXY.html



Is this answer out of date? If it is, please let us know via a Comment

More to Explore

SQL

The Oracle documentation contains a complete SQL reference.