|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
IIB9: Mapping Node , DBSelect Combining Multiple Rows |
« View previous topic :: View next topic » |
Author |
Message
|
akil |
Posted: Tue Nov 11, 2014 12:33 am Post subject: IIB9: Mapping Node , DBSelect Combining Multiple Rows |
|
|
 Partisan
Joined: 27 May 2014 Posts: 338 Location: Mumbai
|
Hi
I have a mapping node that takes an input assembly and a database select, and needs to create one single output assembly/message.
the database select returns two rows, and i need to map the one row to element one and the other row to element two of the output assembly.
Code: |
select contact_type, contact, customer_id from contacts
|
sample result set
Code: |
contact_type | contact | customer_id
phone , 111 , 'C1'
email , hi@me.com, 'C2'
|
the output message needs to look like the following
Code: |
<contact>
<email>hi@me.com</email>
<phone>111</phone>
</contact>
|
_________________ Regards |
|
Back to top |
|
 |
akil |
Posted: Tue Nov 11, 2014 1:50 am Post subject: |
|
|
 Partisan
Joined: 27 May 2014 Posts: 338 Location: Mumbai
|
I used a customXpath to do this
Code: |
fn:contact($contact[1],$contact[2])
|
It would be good to be able to do a self-join instead of an XPath and retrieve just a single row.. _________________ Regards |
|
Back to top |
|
 |
martinb |
Posted: Fri Nov 14, 2014 1:10 am Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
Hi
Self Join can be done, simply wire the repeating input to the target, and then drag another wiring from the same repeating input and drop it on the transform, making it a primary input, and you have a self Join.
Then set a join condition.. Looking at your sample data, it would have made more sense to me if in the resultset rows you showed being joined "customer_id" was matching. Then you could have used "customer_id" as the Join match condition. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|