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 » data not found from dbms call

Post new topic  Reply to topic
 data not found from dbms call « View previous topic :: View next topic » 
Author Message
hornbeam123
PostPosted: Mon May 24, 2004 6:07 am    Post subject: data not found from dbms call Reply with quote

Centurion

Joined: 01 Nov 2003
Posts: 101

All,
Pretty basic query but I can not find any examples in the mqsi books.
Query, see below, is how to deal with row not found on SELECT of a database within a COMPUTE node and UPDATE/DELETE within DATABASE node. One column (Name) is designated as primary key.
Hornbeam123

SELECT dbms in COMPUTE node
===========================
SET OutputRoot.XML.PeopleOnDatabase.Person =
THE (SELECT gripes.Name, gripes.Age
FROM Database.MQSI AS gripes
WHERE gripes.Name = InputBody.PersonalDetails.Person.Name);

How do we test if the SELECT returned from the dbms call 'DATA NOT FOUND' ?

i.e. OutputRoot.XML.PeopleOnDatabase.Person.Name is empty

+++++++++++++++++++++++++++++++++++++++++++

DELETE and UPDATE dbms in DATABASE node
=======================================
IF Body.PersonalDetails.Action = 'Delete' THEN

-- this deletes the row on the database that matches the Name from the incoming XML
DELETE FROM Database.MQSI AS gripes
WHERE gripes.Name = Body.PersonalDetails.Person.Name;

-- Using UPDATE function change the Age field on the database with the NewAge field supplied
ELSE
IF Body.PersonalDetails.Action = 'Update' THEN
UPDATE Database.MQSI as gripes
SET Age = Body.PersonalDetails.Person.NewAge
WHERE gripes.Name = Body.PersonalDetails.Person.Name;
END IF;
END IF;

How can I test if either of the DELETE or UPDATE functions returned Data not found ?[/i]
Back to top
View user's profile Send private message
JT
PostPosted: Mon May 24, 2004 6:42 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Quote:
How do we test if the SELECT returned from the dbms call 'DATA NOT FOUND' ?

i.e. OutputRoot.XML.PeopleOnDatabase.Person.Name is empty

That's the way we handle it. After verifying that the SQLCODE value is zero, we check for the presence of the target field or in the case of a list we check the cardinality of the target.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » data not found from dbms call
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.