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 » Reading values from an array.

Post new topic  Reply to topic
 Reading values from an array. « View previous topic :: View next topic » 
Author Message
Kazim_Baig
PostPosted: Tue Oct 18, 2016 5:06 am    Post subject: Reading values from an array. Reply with quote

Novice

Joined: 26 Apr 2016
Posts: 19
Location: Bangalore

Hi All,

Assume that I have an array which 'x' number of items. Now my requirement is, in an If else statement, I will read the items present in that array and based on the values I will proceed further. This can be achieved by keeping this If Else statement in a loop and increasing the index count from 1 to 'x'. But my question is, is there any way in esql where in I can compare the items in the array with my required parameter for executing the conditional statements? (some key word like EXISTS or CONTAINS)
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Oct 18, 2016 5:18 am    Post subject: Reply with quote

Grand High Poobah

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

So if your array of 'x' items contains an instance of 'value', you perform a block of code otherwise you do not?

You might be able to achieve that with a combination of SELECT, THE & ITEM on the array. Experimentation will yield the truth of that statement; I'm not entirely confident there.

Someone else with a better idea will comment shortly.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
timber
PostPosted: Tue Oct 18, 2016 5:20 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Quote:
This can be achieved by keeping this If Else statement in a loop and increasing the index count from 1 to 'x'
Yes. But that would not be the best way to do it. Please consider using a FOR statement instead.
http://www.ibm.com/support/knowledgecenter/en/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ak05030_.htm
Quote:
is there any way in esql where in I can compare the items in the array with my required parameter for executing the conditional statements? (some key word like EXISTS or CONTAINS)
Yes, there probably is. The Knowledge Center contains a *lot* of information on ESQL: http://www.ibm.com/support/knowledgecenter/en/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ak04900_.htm

If you are feeling brave, you could even consider a SELECT statement.
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 » Reading values from an array.
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.