Author |
Message
|
lung |
Posted: Mon Oct 07, 2002 5:57 pm Post subject: ESQL for SET SUBSTRING(...) |
|
|
 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 |
|
 |
lung |
Posted: Mon Oct 07, 2002 6:00 pm Post subject: |
|
|
 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 |
|
 |
emillions |
Posted: Mon Oct 07, 2002 6:17 pm Post subject: substring |
|
|
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 |
|
 |
lillo |
Posted: Tue Oct 08, 2002 4:09 am Post subject: |
|
|
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 |
|
 |
lung |
Posted: Tue Oct 08, 2002 5:57 pm Post subject: |
|
|
 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 |
|
 |
|