ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Reading/Looping through a Database table

Post new topic  Reply to topic
 Reading/Looping through a Database table « View previous topic :: View next topic » 
Author Message
LH33
PostPosted: Tue Oct 12, 2004 7:00 am    Post subject: Reading/Looping through a Database table Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 12, 2004 7:08 am    Post subject: Reply with quote

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
View user's profile Send private message
LH33
PostPosted: Tue Oct 12, 2004 8:30 am    Post subject: Reply with quote

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
View user's profile Send private message
kirani
PostPosted: Tue Oct 12, 2004 11:22 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Reading/Looping through a Database table
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.