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 » Read from Multiple Tables/Rows using DatabaseInput Node

Post new topic  Reply to topic
 Read from Multiple Tables/Rows using DatabaseInput Node « View previous topic :: View next topic » 
Author Message
whydieanut
PostPosted: Wed Sep 26, 2012 1:42 am    Post subject: Read from Multiple Tables/Rows using DatabaseInput Node Reply with quote

Disciple

Joined: 02 Apr 2010
Posts: 186

Hi all,

I am trying to use the DatabaseInput Node to read data from a source system.
Now there are 2 ways the data from the DB might have to be handled in.

1. Multiple rows of data from a single table might constitute a single Input Message.
2. Multiple rows of data from multiple tables (join) might constitute a single Input Message.

Is there a way that the DatabaseInput Node can be configured to create a single input message for any of the above 2 scenarios?

As for option 1, each row inserted into the Application Table would trigger a single message to be created and sent to the flow. Is using Aggregation an option?
And for option 2, I noticed that the DatabaseInput Node only allows you to select a single Application Table in the configuration screen.


Or is the only option to have a separate Compute/Database node retrieve the complete set of data/rows needed to create a single message.


Please let me know if I am not being clear in my description.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Sep 26, 2012 5:12 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

No. This link may help you.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fbc34040_.htm

You could accomplish this by creating an event table that puts a pointer to all relevant rows in the other tables into one row then have the DatabaseInput node monitor this for changes. When the trigger fires, use the event table row read by the DatabaseInput node to read the rows in the other table through a Compute node to get your full message.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fbc34043_.htm
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
whydieanut
PostPosted: Thu Sep 27, 2012 9:51 pm    Post subject: Reply with quote

Disciple

Joined: 02 Apr 2010
Posts: 186

@lancelotlinc,
I've gone through that and got a basic flow running, which reacts to a single row of data from a single table.
But for the actual scenario, I have to extract data from multiple rows from a single table OR multiple rows from multiple tables to create a single input message (Don't have enough clarity YET on how records are maintained in the source system's DB).


I got option 2 working.
I have 2 tables holding data for a single record/transaction.
Table 1 holds the header data (1 row per record) and Table 2 holds the repeating line item level data.

I set my trigger on Table 1.
So each row in this table generates a single message. In my flow I have a Compute node that selects data from Table 2 using the Primary key from the input message (data from Table 1).


Supposing the data is actually stored in the way mentioned in option 1, is there a way to combine multipe rows of data from a single table into a single message, given that each record/message can be made up of a varying number of DB rows, grouped together only by a primary key column?
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Sep 28, 2012 5:09 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

whydieanut wrote:
Supposing the data is actually stored in the way mentioned in option 1, is there a way to combine multipe rows of data from a single table into a single message, given that each record/message can be made up of a varying number of DB rows, grouped together only by a primary key column?


Yes, most database administrators call this a 'view'.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Fri Sep 28, 2012 5:18 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

lancelotlinc wrote:
whydieanut wrote:
Supposing the data is actually stored in the way mentioned in option 1, is there a way to combine multipe rows of data from a single table into a single message, given that each record/message can be made up of a varying number of DB rows, grouped together only by a primary key column?


Yes, most database administrators call this a 'view'.



_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Read from Multiple Tables/Rows using DatabaseInput Node
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.