|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MAX function not working properly. |
« View previous topic :: View next topic » |
Author |
Message
|
alethea |
Posted: Mon Sep 17, 2007 10:51 pm Post subject: MAX function not working properly. |
|
|
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 |
|
 |
shalabh1976 |
Posted: Tue Sep 18, 2007 10:10 pm Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|