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 » Checking for SELECT that returns no value

Post new topic  Reply to topic
 Checking for SELECT that returns no value « View previous topic :: View next topic » 
Author Message
AlexeiSkate
PostPosted: Thu Jun 13, 2002 9:23 am    Post subject: Checking for SELECT that returns no value Reply with quote

Centurion

Joined: 10 Apr 2002
Posts: 123

I have the folowing ESQL SELECT statements:

SET OutputRoot.XML."TEMP" = THE (SELECT X.UIDY, X.DTYP
FROM Database.DB2USER.MF_CR AS X
WHERE X.DOCUMENT_NUMBER = referencedDocumentNumber);

I then have the following if statement ....

if (OutputRoot.XML."TEMP"."UIDY") IS NULL
THEN
-- WRITE TO DATABASE OF SUSPENSE TABLE
ELSE
-- do something ...

I know that the SELECT statement above did not find any record from the db, but the logic keeps on going to the ELSE part of the IF statement. When I look at UIDY in the trace file, the value is NULL. Is the condidition in my IF statement correct ? How can I check that a SELECT statement did not return anything ?
Thanks,
Alex
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Jun 13, 2002 11:45 am    Post subject: Reply with quote

Jedi Knight

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

Alex,

Try changing your statement to
if (OutputRoot.XML."TEMP"."UIDY".(XML.Content) = NULL )
THEN
....

You can make use of values set in SQLSTATE and SQLCODE variables to see what return values you are getting from database. For doing this, in your Compute Node's Advance tab you should uncheck "Throw Exception on Database Error".
_________________
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 » Checking for SELECT that returns no value
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.