Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenate multiple cursor results Into one row using SPUFI

Status
Not open for further replies.

bibulous

Programmer
May 18, 2007
26
GB
Hi All,

I have googled this as well as searching the forum where I found this (563117) and from what I can gather what I want to do is not possible in SPUFI (I already have it running in a CICS program, I was just intrigued to see if it was possible within SPUFI).

I have a parent table & a child table that has one to many records relating to the parent.
Is there a way of writing a bit of SPUFI that will bring back the parent key & each child record concatenated together into a single row?

For example.
[pre]
T1
PK DESC
1 Row1
2 Row2

T2
FK TYPE DESC
1 1 HELLO
1 2 MY
1 3 NAME
1 4 IS
2 1 JOHN
2 2 SMITH

So that the result would be
T1.PK, T1.DESC, CONCAT_OF_T2.DESC
1 , Row1 , HELLO MY NAME IS
2 , Row2 , JOHN SMITH
[/pre]
I have managed it in SPUFI using joins but I need a join per child row & because I don't know what the maximum would be it's not really feasible (although still useful as most of the time there are 3 rows or less)

If anyone has any advice if this is even possible in SPUFI or can point me in the right direction that would be much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top