IMO, this is a case where you need a HLL to process this efficiently. At the
very least, you might consider doing this as a SQL udf to return a string of
concatenated comments.
Sorry, but I cannot work up an example right now...
Eric
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[
mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Chandana Silva
Sent: Tuesday, April 17, 2007 7:53 AM
To: RPG programming on the AS400 / iSeries
Subject: SQL Concatenation problem
Dear SQL Gurus and all,
I am trying to contcatenate a field recursively for a selected record and
wondering if there is a way to do it,
Here is the problem .. The table below has a field named Comments and I want
to select the Acct, when the Type1 in ('Z') and Type2 in ('X') and conact the
Comments for the five lines where Type1='A'. Object to get only two records
from the Select statement for the following.
Trying to get this for Comments:
Received a call from Xxxx regarding past due payment,
advised could not make both this month and next....
ACCT COMMENTS TYPE1 TYPE2 12345678 Received a call
from Xxxx regarding past due payme Z X 12345678 nt, advised could not
make both this month and nex A 12345678 t month payments by 06-01-2007.
Transferred to Bank A 12345678 Branch. Contact Ph# - 1111111111 A
12345678 >>> SMITHBOY1 A 12345678 Received a call from Xx regarding
past due payment Z X 12345678 , advised could not make both this month
and next A 12345678 month payments by 06-01-2007. Transferred to Default
A 12345678 s. Contact Ph# - 1111111111 A 12345678 >>> JOHNDOE1
A
Greatly appreciate your kind help and time ..
As an Amazon Associate we earn from qualifying purchases.