|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Wrong SQLCODE/SQLSTATE using the indicator in V2.1 |
« View previous topic :: View next topic » |
Author |
Message
|
samuel_lee2000 |
Posted: Thu Apr 25, 2002 2:36 am Post subject: |
|
|
Novice
Joined: 07 Apr 2002 Posts: 13
|
Platform used : WMQI v2.1 CSD2 on Windows 2000
We're trying to use the database indicators to get the error information.
But we're getting the wrong SQLCODE and SQLSTATE. Have anyone tried the new feature successfully ? Is there any special steps we need to do ?
Thanks for any advice !!
Here is our ESQL code fragment :
-------------------------------------------------------------------------
DECLARE SQLState1 CHARACTER;
DECLARE SQLCode1 INTEGER;
SET OutputRoot.XML.DB.Result[] = (SELECT ITEM T.EMPNOX FROM Database.db2admin.EMPLOYEE AS T);
SET SQLState1 = SQLSTATE;
SET SQLCode1 = SQLCODE;
IF SQLCode1 <> 0 THEN
THROW USER EXCEPTION MESSAGE 2950 VALUES ('The SQL State', SQLState1, SQLCode1);
END IF;
-------------------------------------------------------------------------
We've unchecked the "Throw database on Database exception" in the Advanced tab of the Compute Node.
The expected result should be SQLCODE = -206 and SQLSTATE = 42703
Because we can see the following in the trace file ExceptionList :
[IBM][CLI Driver][DB2/NT] SQL0206N "T.EMPNOX" is not valid in the context where it is used. SQLSTATE=42703
However, what we actually get using the indicator is :
SQLSTATE = 42S22
SQLCODE = -1
Using the MQSI trace, we know that the SQLSTATE indicator get resolved to 42S22
and SQLCODE indicator get resolved to -1 by MQSI. So is it WMQI is passing the wrong value back ?
[ This Message was edited by: samuel_lee2000 on 2002-04-25 03:37 ] |
|
Back to top |
|
 |
kirani |
Posted: Thu Apr 25, 2002 10:36 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Have you looked at the values of SQLNATIVEERROR? That should give you value -206.
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
samuel_lee2000 |
Posted: Thu Apr 25, 2002 6:19 pm Post subject: |
|
|
Novice
Joined: 07 Apr 2002 Posts: 13
|
Thanks for your advice!
We could find the -206 SQLCODE in the SQLNATIVEERROR indicator. However, does it mean that the SQLCODE and SQLSTATE indicator is not working ?
We are using the following DB2 version on Windows 2000:
Version : 7
Release : 1
Modification : 3
Service Level : WR21254
Thanks !!
|
|
Back to top |
|
 |
Miriam Kaestner |
Posted: Fri Apr 26, 2002 2:02 am Post subject: |
|
|
Centurion
Joined: 26 Jun 2001 Posts: 103 Location: IBM IT Education Services, Germany
|
I don't know if this may be the reason, but I also had lots of problems with DB2 7.1 Fixpack 3. The IBM Support Site states:
"Note: At DB2 V7.1 Fix Pack 3 or DB2 V7.2 (GA), there is a known problem with ESQL syntax generating ODBC escape sequences. This is resolved in Fix Pack 4"
|
|
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
|
|
|
|