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 » Basic ESQL question : Why does my SET and IF/ELSE work this

Post new topic  Reply to topic
 Basic ESQL question : Why does my SET and IF/ELSE work this « View previous topic :: View next topic » 
Author Message
PeterPotkay
PostPosted: Mon Mar 11, 2002 10:19 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

Here is the message I drop onto the queue:
<Request><EmpNo>000100</EmpNo><RequestType>NEW</RequestType><OrderNo>999999</OrderNo></Request>


Here is my Compute Node ESQL:
SET OutputRoot = InputRoot;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputRoot.XML.Request.OrderNo = '123456';
IF InputRoot.XML.Request.EmpNo = '000100'
THEN
SET OutputRoot.XML.Request.Country = 'AMERICA';
ELSE
IF InputRoot.XML.Request.EmpNo = '000200'
THEN
SET OutputRoot.XML.Request.Country = 'UNITED KINGDOM';
ELSE
SET OutputRoot.XML.Request.Country = 'DENMARK';
END IF;
END IF;
SET OutputRoot.XML.Request.Version = '000005';


And this is what I get in my out queue:
<Request><EmpNo>000100</EmpNo><RequestType>NEW</RequestType><OrderNo>999999</OrderNo></Request><Request><OrderNo>123456</OrderNo><Country>DENMARK</Country><Version>000005</Version></Request>


Questions:
1. I am trying to change OrderNo from 999999 to 123456, but instead I append a second OrderNo to the end of the message. How do I just change it rather than duplicating it?

2. Why do I keep dropping thru the IF statement to the last ELSE? The message coming in has an EmpNo of '000100', so why isn't the first IF catching it?

Also, why the heck did my post come out so wide? I have to scroll to see it all.
_________________
Peter Potkay
MQSeries Certified Specialist

[ This Message was edited by: PeterPotkay on 2002-03-11 10:20 ]

[ This Message was edited by: PeterPotkay on 2002-03-11 10:36 ]
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Mon Mar 11, 2002 11:30 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

I had forgotten to set the Message Domain field to "XML" on the Input node. Once I did that, the code worked just fine.




_________________
Peter Potkay
Keep Calm and MQ On
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 » Basic ESQL question : Why does my SET and IF/ELSE work this
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.