Author |
Message
|
chauhan_samir |
Posted: Mon Mar 06, 2006 2:10 am Post subject: Accessing multiple database in WBIMB 5.0 |
|
|
 Novice
Joined: 25 Aug 2005 Posts: 14 Location: USA
|
Hi,
Please bare with me if I ask any silly question.
I want to access two different database in my message flow(WBIMB 5.0). In my previous implementations I have used database using ESQL but only one database in a flow. I was going through the PDF and I found that I cannot have database name after Database keyord in ESQL. Like
Code: |
Database.[DatabaseName].[SchemaName].[TableName] |
I have never used Database node before. Can anyone help me how to resolve this problem. Its okay even if I have to used Database node.
My requirement is, I will get a message and based on some value, I will have to update either of the database.
Thanks in advance.
Regards,
Samir |
|
Back to top |
|
 |
mgk |
Posted: Mon Mar 06, 2006 2:15 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi.
In version 5 you can only access one database per node. The database MUST be specified in the Datasource atttribute on the node. If you want to access two different databases, you must use two different nodes.
In V6 you can access more than one DB per node, in you format you specify (Database.[DatabaseName].[SchemaName].[TableName]) but they must all be of the same type (all DB2, all Oracle, all SQLServer etc).
regards,
MGK _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Mar 06, 2006 2:24 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi chauhan_samir,
Quote: |
My requirement is, I will get a message and based on some value, I will have to update either of the database. |
Check the condition(Filter Node) and wire the output to two different database nodes based on the result.
Regards |
|
Back to top |
|
 |
chauhan_samir |
Posted: Mon Mar 06, 2006 2:27 am Post subject: Re : Accessing multiple database in WBIMB 5.0 |
|
|
 Novice
Joined: 25 Aug 2005 Posts: 14 Location: USA
|
Thanks MGK for your quick answer.
Can you please give me some more idea on using Database node for multiple database source? As you said I shoud have two Database node in my message flow.
* Now to insert record in database I have to use DataInsert node? Or I can use ESQL?
* how will do I write my code or which property I set so the correct database is being refered at runtime.
I also forgot to mention that I am not using Message Sets. As per my understanding I should have message set if I want to use DataInsert node.
Thanks,
Regards,
Samir |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Mar 06, 2006 2:31 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi chauhan_samir,
Yes you need a message set if you want to map the message to the database table.
Also in database nodes you cannot alter the InputRoot, so the message through the node will be the same....i.e if you are interestd in the message after this node.
Use the compute node.
Regards. |
|
Back to top |
|
 |
chauhan_samir |
Posted: Mon Mar 06, 2006 2:49 am Post subject: Re : Accessing multiple database in WBIMB 5.0 |
|
|
 Novice
Joined: 25 Aug 2005 Posts: 14 Location: USA
|
Hi elvis_gn,
One of my question is still unanswered.
i.e.
Quote: |
Now to insert record in database I have to use DataInsert node? Or I can use ESQL? |
To elaborate this, let say I have a filter node following with two database base node. One is linked to True terminal and second to False terminal of Filter. At runtime based on the filter result, one path will be taken and I will be connected to one datasource. In the following compute node, can I use ESQL to insert record in database.
Code: |
Database.[SchemaName].[TableName] |
Will this work out? Or I have to use DataInsert node becuase I am using Database node.
Regards
Samir |
|
Back to top |
|
 |
mgk |
Posted: Mon Mar 06, 2006 2:51 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
Quote: |
* Now to insert record in database I have to use DataInsert node? Or I can use ESQL? |
You can use ESQL in a Compute or Database or Filter node. Look up the INSERT statement in the docs.
Quote: |
* how will do I write my code or which property I set so the correct database is being refered at runtime. |
In V5 you set the Datasource attribute on the node at design time when you are building your flow (or at deploy time if you have prompted the attribute). You cannot change the Datasource or schema or table name dynamically at runtime in V5.
Please try looking at the docs a little before posting  _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
wschutz |
Posted: Mon Mar 06, 2006 2:52 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
you can do database inserts / selects / updates and deletes from an ESQL compute node, just set the Datasource property on the node ..... you don't need to use a database node. _________________ -wayne |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Mar 06, 2006 2:58 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi chauhan_samir,
Quote: |
Or I have to use DataInsert node becuase I am using Database node |
I dont get this, where are u using Database node ?
And I think I did answer the situation in which to use what....
* If you do not want to make any change in your message before putting it into the table AND dont want a different output message, use the DataInsert node
* if you want to change the values (not simple things like CAST etc, it would be like SUBSTRING etc ) before putting into table BUT do not want to change the message structure and get it after the node THEN use the Database node
* AND if u want to get a new message after the inserts, use the compute.
Regards. |
|
Back to top |
|
 |
chauhan_samir |
Posted: Mon Mar 06, 2006 3:07 am Post subject: |
|
|
 Novice
Joined: 25 Aug 2005 Posts: 14 Location: USA
|
Thanks elvis_gn and Thanks to all other guys who have answered my queries.
Now I am very much clear to design my next implementation. I will get rest of the help from PDFs.
Thanks again.
Regards, |
|
Back to top |
|
 |
|