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 » URGENT: problem with PASSTHRU in ESQL

Post new topic  Reply to topic
 URGENT: problem with PASSTHRU in ESQL « View previous topic :: View next topic » 
Author Message
know_ashu
PostPosted: Thu Sep 15, 2005 1:18 am    Post subject: URGENT: problem with PASSTHRU in ESQL Reply with quote

Novice

Joined: 25 Jun 2005
Posts: 22

Hi,
I am using passthru for most of my queries as i have complex database queries so passthru was the better option to use. I am calling table names as schema.tableName.

for example (this is just a simple example to show the use of schema name)
PASSTHRU(select T.c1 from SCHEMA1.Table1 AS T where T.c2 = ?, 'ABC')

Now my code is moving from Dev to Test environment where the schema name is changing.
is there any workaround to use different schema name with the same passthru? (Schema names for DEV/TEST/PROD environments cannot be changed).
Back to top
View user's profile Send private message
aq
PostPosted: Thu Sep 15, 2005 5:03 am    Post subject: Reply with quote

Apprentice

Joined: 20 Dec 2001
Posts: 47

We are currently using PASSTHRU with stored procedure calls, in PASSTHRU we omit the schema name so the broker takes the schema name from the user id that we have registered as app. db datasource for broker(mqsisetdbparms). So using different db user for each environment would be one way to skip "hardcoding" the schema in PASSTHRU statements.

Another way that comes to mind would be using the same schema name all the time in PASSTHRU, and then define alias (in DB2) or similiar db object mapping to correct schema in each environment.

Regards,
aq
Back to top
View user's profile Send private message
JT
PostPosted: Thu Sep 15, 2005 5:42 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Perhaps something like this:

Code:
DECLARE schemaName CHARACTER;

IF DEV THEN
   SET schemaName = 'Schema1';
ELSE
   SET schemaName = 'Schema2';
END IF;

DECLARE sqlStatement CHARACTER 'select T.c1 from ' || schemaName ||'.Table1 AS T where T.c2 = ?';

SET whatever = PASSTHRU(sqlStatement, 'ABC');
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 » URGENT: problem with PASSTHRU in ESQL
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.