Author |
Message
|
rohank84 |
Posted: Tue Feb 03, 2009 2:07 am Post subject: compare size of two arrays |
|
|
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 |
|
 |
mgk |
Posted: Tue Feb 03, 2009 2:17 am Post subject: |
|
|
 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 |
|
 |
rohank84 |
Posted: Tue Feb 03, 2009 2:24 am Post subject: |
|
|
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 |
|
 |
paranoid221 |
Posted: Tue Feb 03, 2009 3:10 am Post subject: |
|
|
 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 |
|
 |
rohank84 |
Posted: Tue Feb 03, 2009 4:48 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Tue Feb 03, 2009 5:17 am Post subject: |
|
|
 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 |
|
 |
MQEnthu |
Posted: Thu Feb 05, 2009 1:08 am Post subject: |
|
|
 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 |
|
 |
|