September 28, 2021 at 9:03 pm
I sometimes run queries against an IBM DB2 database, using an old Navigator tool that has limited functions. In some cases I want the results in 1 pane, so I can do various string searches with CTL-F.
Typical # of result rows is less than 1000.
It's probably equivalent to SQL 7 as far and functionality goes.
Is there a way to write a query to dump all the result rows, with line breaks, into 1 result ?
September 28, 2021 at 9:26 pm
A quick search for IBM DB2 equivalent of SQL Server STRING_AGG leads to the LISTAGG function in DB2.
September 29, 2021 at 4:16 pm
That might work if I can figure out how to get line breaks after each row.
September 30, 2021 at 1:53 am
That might work if I can figure out how to get line breaks after each row.
CHR(10) should work as the "separator".
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply