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 » Dynamically setting Datasource name in query

Post new topic  Reply to topic
 Dynamically setting Datasource name in query « View previous topic :: View next topic » 
Author Message
Vanshul_MB
PostPosted: Tue May 31, 2011 9:52 pm    Post subject: Dynamically setting Datasource name in query Reply with quote

Acolyte

Joined: 09 Feb 2011
Posts: 68

Hi,

My query is like this

SET Environment.Variables.ConfigData.OTA_Chain_Codes[]=PASSTHRU ('SELECT CHAIN_CD FROM HTLCONT.CHAIN WHERE CHAIN_ID IN(SELECT CHAIN_ID FROM HTLCONT.SRC_CHAIN_ASOC WHERE SRC_ID IN(SELECT SRC_ID FROM ESBLYR.APP WHERE APP_ID=?))' TO Database.ESBLYR VALUES (appID));

We have a requirement that we need to override this value for each environment as DSN name differs.

Can you please help me here?
Back to top
View user's profile Send private message
Gemz
PostPosted: Tue May 31, 2011 10:00 pm    Post subject: Reply with quote

Centurion

Joined: 14 Jan 2008
Posts: 124

Consider using an EXTERNAL variable.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ak01015_.htm
_________________
GemZ
"An expert is one who knows more and more about less and less until he knows absolutely everything about nothing...."
Back to top
View user's profile Send private message
Vanshul_MB
PostPosted: Tue May 31, 2011 10:05 pm    Post subject: Reply with quote

Acolyte

Joined: 09 Feb 2011
Posts: 68

I just DECLARE a CHARACTER for my testing.But it gives an error.

DECLARE DBName CHARACTER 'ESBLYR';

Then in query i used Database.DBName
Throws an error that Data source not found
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue May 31, 2011 11:10 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Vanshul_MB wrote:
I just DECLARE a CHARACTER for my testing.But it gives an error.

DECLARE DBName CHARACTER 'ESBLYR';


Did you try the {} around the name
Code:

SET Environment.Variables.ConfigData.OTA_Chain_Codes[]=PASSTHRU ('SELECT CHAIN_CD FROM HTLCONT.CHAIN WHERE CHAIN_ID IN(SELECT CHAIN_ID FROM HTLCONT.SRC_CHAIN_ASOC WHERE SRC_ID IN(SELECT SRC_ID FROM ESBLYR.APP WHERE APP_ID=?))'
TO Database.{ESBLYR} VALUES (appID));

_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 01, 2011 2:24 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

smdavies99 wrote:
Vanshul_MB wrote:
I just DECLARE a CHARACTER for my testing.But it gives an error.

DECLARE DBName CHARACTER 'ESBLYR';


Did you try the {} around the name
Code:

SET Environment.Variables.ConfigData.OTA_Chain_Codes[]=PASSTHRU ('SELECT CHAIN_CD FROM HTLCONT.CHAIN WHERE CHAIN_ID IN(SELECT CHAIN_ID FROM HTLCONT.SRC_CHAIN_ASOC WHERE SRC_ID IN(SELECT SRC_ID FROM ESBLYR.APP WHERE APP_ID=?))'
TO Database.{ESBLYR} VALUES (appID));


You mean
Code:
TO Database.{DbName}
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 » Dynamically setting Datasource name in query
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.