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 » compare size of two arrays

Post new topic  Reply to topic
 compare size of two arrays « View previous topic :: View next topic » 
Author Message
rohank84
PostPosted: Tue Feb 03, 2009 2:07 am    Post subject: compare size of two arrays Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

Hi guys ,

How can i compare the size of two arrays ....i have an array of shared variable and an environment variable array .. i want to get the size of bothe the arrays....
Back to top
View user's profile Send private message
mgk
PostPosted: Tue Feb 03, 2009 2:17 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

By size do you mean number of elements or the content of the elements as well as the number of them? If it is number, then you can use cardinality to count elements. If it is content as well the you can just use the ESQL equality operator between each array reference - ESQL allows message trees to be "deep compared" simply by using the equality operator.

Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
rohank84
PostPosted: Tue Feb 03, 2009 2:24 am    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

hi ...i need to know the number of element ....do u have any examples on how to use cardinality
Back to top
View user's profile Send private message
paranoid221
PostPosted: Tue Feb 03, 2009 3:10 am    Post subject: Reply with quote

Centurion

Joined: 03 Apr 2006
Posts: 101
Location: USA

Urghh!!!! Urghh!!! Urghhh!! MB Documentation , mebbe Urghhhh Urghhh Urghh
_________________
LIFE is a series of complex calculations, somewhere multiplied by ZERO.
Back to top
View user's profile Send private message
rohank84
PostPosted: Tue Feb 03, 2009 4:48 am    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

hi im using comaprison operators like this

SET CacheQueueTable.DestinationData[] = (Select emp.email,emp.name,emp.hostname from Database.EMP_DETAILS as emp WHERE emp.hostname = chardata);
set Environment.Variables.TCP.SIZE[] = (Select emp.email,emp.name,emp.hostname from Database.EMP_DETAILS as emp WHERE emp.hostname = chardata);

if CacheQueueTable.DestinationData[] <> Environment.Variables.TCP.SIZE[] then
set CacheQueueTable.valid value = null;
SET CacheQueueTable.DestinationData[] = (Select emp.email,emp.name,emp.hostname from Database.EMP_DETAILS as emp WHERE emp.hostname = chardata);
set Environment.Variables.Log4j.LogText = 'Updating the Cache';
end if;


here im comparing two arrays ...query fired both are same but its still prints the log4j statements .......
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 03, 2009 5:17 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

rohank84 wrote:
hi im using comaprison operators like this
...
here im comparing two arrays ...query fired both are same but its still prints the log4j statements .......


These are not doing what you think they're doing. Review the manual.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
MQEnthu
PostPosted: Thu Feb 05, 2009 1:08 am    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

Quote:
hi ...i need to know the number of element ....


the ESQL statements you have written does not calculate the number of element...


________________________
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 » compare size of two arrays
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.