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 » How to check for nonsuccessful SELECT in ESQL

Post new topic  Reply to topic
 How to check for nonsuccessful SELECT in ESQL « View previous topic :: View next topic » 
Author Message
AlexeiSkate
PostPosted: Mon Jul 22, 2002 3:51 pm    Post subject: How to check for nonsuccessful SELECT in ESQL Reply with quote

Centurion

Joined: 10 Apr 2002
Posts: 123

I have the following ESQL statement:

SET Environment.Variables.Query.Response[] =
(SELECT T.* FROM Database.DB2USER.DEPOSIT_TICKET_PARAMETER_TABLE as T
WHERE T.CHAIN_NUMBER = Environment.Variables.ChainNumber);

I want to check if the SELECT was successful by using 'IF Environment.Variables.Query.Response IS NOT NULL THEN ...' but I don't think that was the right way to do it. I can do something similar for the XML msg body, but what is the correct way for the Environment tree ?


thanks,
Alex
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Jul 22, 2002 4:47 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Alex,

You could check for value set in SQLSTATE variable? You need to uncheck the checkbox in your Compute node (in Advaced tab) for "Throw Exception on Database Errors". For example,

SET Environment.Variables.Query.Response[] =
(SELECT T.* FROM Database.DB2USER.DEPOSIT_TICKET_PARAMETER_TABLE as T
WHERE T.CHAIN_NUMBER = Environment.Variables.ChainNumber);

IF ( SQLSTATE = 100 ) THEN
-- row not found processing goes here ...
END IF;

-- Throw Exception if any database error occurs
if ( SQLCODE <> 0) THEN
THROW USER EXCEPTION ...
END IF;
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to check for nonsuccessful SELECT in ESQL
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.