|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
MB v6 - How to access multiple Databases |
« View previous topic :: View next topic » |
Author |
Message
|
mgk |
Posted: Tue Jul 04, 2006 5:55 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
I'm at a loss here. I've searched thru the manuals and other posts on this site and I have yet to see an example where someone is using both dynamic data sources with input parameters to a query. |
To do this you need to use the VALUES clause. See the PASSTHRU syntax diagram in the manual.
From the Manual entry for PASSTHHRU:
Quote: |
If the VALUES clause is specified, its expressions are evaluated and passed to the database as parameters; (that is, their values are substituted for the question marks in the database statement). |
Regards, _________________ 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 |
|
 |
shrek |
Posted: Wed Jul 05, 2006 9:22 am Post subject: |
|
|
 Acolyte
Joined: 19 Feb 2005 Posts: 61 Location: Gudivada,India
|
I had success doing the following
DECLARE dsnName NAME TRIM(InputRoot.XML.Test.DataSource);
DECLARE sqlStmt CHAR TRIM(InputRoot.XML.Test.Statement);
Quote: |
/*!{SET Environment.Variables.SQLResult[] = PASSTHRU(sqlStmt TO Database.dsnName);}!*/ |
Thanks. |
|
Back to top |
|
 |
moogoo |
Posted: Wed Jul 05, 2006 11:40 am Post subject: |
|
|
Acolyte
Joined: 20 Sep 2002 Posts: 54 Location: US
|
Great...looks like the VALUES clause did it. Still get a warning label in the toolkit for that statement, but everything deploys and works as expected. And this is still before the CSD01 update for the toolkit.
Thanks a bunch for everyone's help.
MG |
|
Back to top |
|
 |
trongbx |
Posted: Mon Jun 15, 2009 1:01 am Post subject: how to access to multi database from the same compute node |
|
|
Novice
Joined: 23 Nov 2008 Posts: 21
|
mgk wrote: |
Hi,
If you look in the docs at each of the database access functions / statements (INSERT, UPDATE, DELETE, SELECT, PASSTHRU, CALL) you will see that they have all been updated to allow a DSN (and schema) clause. This allows you to choose a DSN at runtime (maybe based on an incoming message) for each database operation, and even a different DSN each time the same operation is executed if necessary.
The main restriction with this capability is that each DSN accessed in the same node, must be of the same type (ORACLE, DB2 etc).
Regards, |
Could you please give me the detail information or an example to do that? I'm working on the project that access to three databases from the same compute node.
Thank you very much. |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|