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 » Wrong SQLCODE/SQLSTATE using the indicator in V2.1

Post new topic  Reply to topic
 Wrong SQLCODE/SQLSTATE using the indicator in V2.1 « View previous topic :: View next topic » 
Author Message
samuel_lee2000
PostPosted: Thu Apr 25, 2002 2:36 am    Post subject: Reply with quote

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
View user's profile Send private message
kirani
PostPosted: Thu Apr 25, 2002 10:36 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
samuel_lee2000
PostPosted: Thu Apr 25, 2002 6:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Miriam Kaestner
PostPosted: Fri Apr 26, 2002 2:02 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Wrong SQLCODE/SQLSTATE using the indicator in V2.1
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.