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 » MAX function not working properly.

Post new topic  Reply to topic
 MAX function not working properly. « View previous topic :: View next topic » 
Author Message
alethea
PostPosted: Mon Sep 17, 2007 10:51 pm    Post subject: MAX function not working properly. Reply with quote

Apprentice

Joined: 30 Jul 2007
Posts: 45

Hi All.
I am working on WMB 6.0 and I am using the MAX function this way.

SET maxSeqNum = THE (SELECT MAX(A.addressSeq) FROM Environment.Variable.InputAddressSeq[] AS A)

where Environment.Variable.InputAddressSeq[].addressSeq has values {7,1,10,9,4,3,2,6,8,5}.

The strange thing happening over here is it gives maxSeqNum=9 instead of 10.
And if I try to put the above mentioned values in ascending order instead of random it gives the maxSeqNum correctly i.e 10 in this case.

Can anyone please help to identify the problem.
Thanks in advance.
Back to top
View user's profile Send private message
shalabh1976
PostPosted: Tue Sep 18, 2007 10:10 pm    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

I have tested what you are saying. I get 10 as my answer.
Here is my code:
Code:
      SET Environment.Variable.InputAddressSeq[1].addressSeq = 7;
      SET Environment.Variable.InputAddressSeq[2].addressSeq = 1;
      SET Environment.Variable.InputAddressSeq[3].addressSeq = 10;
      SET Environment.Variable.InputAddressSeq[4].addressSeq = 9;
      SET Environment.Variable.InputAddressSeq[5].addressSeq = 4;
      SET Environment.Variable.InputAddressSeq[6].addressSeq = 3;
      SET Environment.Variable.InputAddressSeq[7].addressSeq = 2;
      SET Environment.Variable.InputAddressSeq[8].addressSeq = 6;
      SET Environment.Variable.InputAddressSeq[9].addressSeq = 8;
      SET Environment.Variable.InputAddressSeq[10].addressSeq = 5;
      SET OutputRoot.XML.out = THE (SELECT MAX(A.addressSeq) FROM Environment.Variable.InputAddressSeq[] AS A);

Please check how you are populating the array.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MAX function not working properly.
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.