|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
db2cli.ini file.. |
« View previous topic :: View next topic » |
Author |
Message
|
selfown |
Posted: Mon Oct 24, 2005 3:57 am Post subject: db2cli.ini file.. |
|
|
Apprentice
Joined: 07 Jan 2005 Posts: 39
|
Hi,
I'm trying to access a table on a remote machine.
The database is DB2 and I've run mqsisetdbparms.
Everything works fine as long the schema name is mentioned in the ESQL.
The following is the ESQL code i'm using
SELECT R.* FROM Database.ADMIN.SAMPLETABLE AS R
WHERE R.NAME = 99)
where admin is the schema name.
Instead of hardcoding the schema name in the code, I removed the schema name from the code and added the currentSchema in the db2cli.ini file.
The following is the db2cli.ini file contents
[SAMPLE]
CURRENTSCHEMA=ADMIN
DBALIAS=SAMPLE
UID=username
Now, the query is processed but no records are fetched from the table eventhough there are records which satisfy the query.
What I want to know is that "Is it mandatory to mention the schema name in the esql code".
Thanks |
|
Back to top |
|
 |
JT |
Posted: Mon Oct 24, 2005 6:00 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Quote: |
What I want to know is that "Is it mandatory to mention the schema name in the esql code". |
Not statically you don't. The following is possible, where the value of Environment.Variables.schemaName is arrived at dynamically elsewhere in the messageflow:
Code: |
DECLARE sqlStatement CHARACTER 'SELECT R.* FROM ' || Environment.Variables.schemaName ||'.SAMPLETABLE AS R WHERE R.NAME = ?';
SET Environment.Variables.resultSet[] = PASSTHRU(sqlStatement, 99); |
|
|
Back to top |
|
 |
wschutz |
Posted: Mon Oct 24, 2005 6:14 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
And in Broker V6, you can have the database name, schema and table names variables and expressions that are evaluated at run time.
SELECT blah blah FROM Database.{dbName}.{schemaName}.{tableName} blah blah ... _________________ -wayne |
|
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
|
|
|
|