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 » Convert String into an Array of Charaters?

Post new topic  Reply to topic
 Convert String into an Array of Charaters? « View previous topic :: View next topic » 
Author Message
NiceGuy
PostPosted: Wed Aug 25, 2010 1:39 pm    Post subject: Convert String into an Array of Charaters? Reply with quote

Apprentice

Joined: 11 Jun 2009
Posts: 37

Hi community,

I need to a way evaluate the individual characters in a string in ESQL.

For example:
Code:


DECLARE myMsg CHARACTER 'Some Message Value';

WHILE i < size THEN

  IF myMsg[i] = 'M' THEN
    -- do something
  END IF;
  SET i = i +1;

END WHILE;


So I suppose what I am looking for is a way to treat a string
like an array of characters.

Please note this is a completely watered down example and is in
no way my actual example .. but the idea is still the same .. that is
I do have a message that I want to evaluate on a character by
character basis.

Again this is an ESQL compute node not a Java Compute node.

Thanks for your time.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 25, 2010 3:36 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

ESQL doesn't have any notion of an array at all.

You could use SUBSTRING to produce a ROW of individual characters.

But you're probably better off using SUBSTRING to extract the actual pieces you need, like SUBSTRING(string from i for 1)

Or construct a string that matches the full set of conditions you need to test against - like if you need to find out if char[1] is 'q' and char[2] is 'B', then test if the string is equal to 'qB'.
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 » Convert String into an Array of Charaters?
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.