|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Reading/Looping through a Database table |
« View previous topic :: View next topic » |
Author |
Message
|
LH33 |
Posted: Tue Oct 12, 2004 7:00 am Post subject: Reading/Looping through a Database table |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
For a message flow, I'm looking to see how I can accomplish the following: Based on the presence of a specific tag in the XML on the Input Node, I then want to read a database table that has for example 10 records. I want to read all 10 records in the table and for each record read, format an XML message to write to a queue. Can anyone help me with an approach or examples of how this can be done? I am on version 2.1.
Thanks! Lisa |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 12, 2004 7:08 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
In a compute node, that is set to neither copy message headers or copy entire message,
Pseudo code
Code: |
if (tag exists or has appropriate value) then
set Environment.Variables.Result[] = SELECT from table
for each row in Environment.Variables.Result
copy message headers
create XML output message for current row
PROPAGATE
set current row to next row
end for
end if
|
Follow with an MQ output node. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
LH33 |
Posted: Tue Oct 12, 2004 8:30 am Post subject: |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
Thank you!
Any suggestions on how I would delete the messages from the table after successfully putting the XML on the Oupput node queue?
Thanks! Lisa |
|
Back to top |
|
 |
kirani |
Posted: Tue Oct 12, 2004 11:22 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
You can either use FlowOrder node to create two branches, First will be connected to your Compute node followed by your MQOutput node, Second will be connected to DB node where you will delete rows from table. OR you can connect a DB/Compute node after MQOutput node and delte the rows there. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
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
|
|
|
|