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 » ESQL for SET SUBSTRING(...)

Post new topic  Reply to topic
 ESQL for SET SUBSTRING(...) « View previous topic :: View next topic » 
Author Message
lung
PostPosted: Mon Oct 07, 2002 5:57 pm    Post subject: ESQL for SET SUBSTRING(...) Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

Let's say there's a field consisting of 4 digits in an XML message... ('1234')
I'm trying to change only the 2nd digit in the message... (Changing '2' to '9' to form '1934')

I tried using the following code...
Code:
SET SUBSTRING(OutputRoot.XML.Msg.FieldA FROM 2 to 1) = '9';

But unfortunately SET and SUBSTRING doesn't work together... It gives me syntax error

Any alternatives? Thanks!
_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
lung
PostPosted: Mon Oct 07, 2002 6:00 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

Sorry, the code was supposed to be
Code:
SET SUBSTRING(OutputRoot.XML.Msg.FieldA FROM 2 FOR 1) = '9';



_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
emillions
PostPosted: Mon Oct 07, 2002 6:17 pm    Post subject: substring Reply with quote

Newbie

Joined: 23 Jul 2002
Posts: 4
Location: Calgary, Canada

Try something similar to the following instead:

[code]SET OutputRoot.XML.Msg.FieldA =
SUBSTRING(InputRoot.XML.Msg.FieldA FROM 1 FOR 1) || '9' || SUBSTRING(InputRoot.XML.Msg.FieldA FROM 3 FOR 2);

- Evelyn
Back to top
View user's profile Send private message Send e-mail
lillo
PostPosted: Tue Oct 08, 2002 4:09 am    Post subject: Reply with quote

Master

Joined: 11 Sep 2001
Posts: 224

Try the following code:
Quote:
SET OutputRoot.XML.Msg.FieldA = OVERLAY(InputRoot.XML.Msg.FieldA PLACING '9' FROM 2 FOR 1);


Cheers,
_________________
Lillo
IBM Certified Specialist - WebSphere MQ
Back to top
View user's profile Send private message
lung
PostPosted: Tue Oct 08, 2002 5:57 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

Thanks all for your response.

But what if my input message and my output message have an entirely different message layout? (selected 'copy message headers' in compute node)

Thanks!
_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » ESQL for SET SUBSTRING(...)
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.