|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
URGENT: problem with PASSTHRU in ESQL |
« View previous topic :: View next topic » |
Author |
Message
|
know_ashu |
Posted: Thu Sep 15, 2005 1:18 am Post subject: URGENT: problem with PASSTHRU in ESQL |
|
|
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 |
|
 |
aq |
Posted: Thu Sep 15, 2005 5:03 am Post subject: |
|
|
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 |
|
 |
JT |
Posted: Thu Sep 15, 2005 5:42 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|