|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Using Database Name and Schema in PASSTHRU query not working |
« View previous topic :: View next topic » |
Author |
Message
|
wmb_wps_soa |
Posted: Fri Feb 04, 2011 9:04 am Post subject: Using Database Name and Schema in PASSTHRU query not working |
|
|
Acolyte
Joined: 19 Feb 2010 Posts: 65 Location: Detroit,Michigan,USA.
|
Guys,
I am encountering a problem with WMB7. The problem is , PASSTHRU with Database name and Schema name is not working and getting an error "[IBM][CLI Driver][DB2/NT] SQL0108N The name "TEST_TABLE" has the wrong number of qualifiers. SQLSTATE=42601 "
The constructed query is as below:
DELETE FROM Database.SAMPLE.XPMUSER.TEST_TABLE WHERE STAFFNUM=123456 AND FIRSTNAME='COOL'
And here is how the PASSTHRU is being constructed:
SET conditionList = KeyName || '=' ||''''|| keyValue ||''''||'';
SET dynamicDeleteQuery = 'DELETE FROM Database.' || databaseName || '.' || dbSchema || '.' || dbTable || ' WHERE ' || conditionList;
PASSTHRU(dynamicDeleteQuery);
Can anyone please help?
Thanks,
Jeba |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Feb 04, 2011 9:14 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
PASSTHRU uses standard SQL syntax, not ESQL syntax.
That's why it's called "passthru" because the statement "passes through" the ESQL environment into the SQL environment. |
|
Back to top |
|
 |
wmb_wps_soa |
Posted: Fri Feb 04, 2011 10:51 am Post subject: |
|
|
Acolyte
Joined: 19 Feb 2010 Posts: 65 Location: Detroit,Michigan,USA.
|
It worked fine after I removed the word "Database" from the PASSTHRU statement.
The working PASSTHRU is as below:
SET dynamicDeleteQuery = 'DELETE FROM ' || databaseName || '.' || dbSchema || '.' || dbTable || ' WHERE ' || conditionList;
PASSTHRU(dynamicDeleteQuery);
Thank you Guys
Surendra |
|
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
|
|
|
|