|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to concatenate two strings in ESQL? |
« View previous topic :: View next topic » |
Author |
Message
|
wmb_worker |
Posted: Sat Jan 10, 2009 12:24 pm Post subject: How to concatenate two strings in ESQL? |
|
|
Novice
Joined: 14 Dec 2008 Posts: 11
|
Cannot figure this one out:
--pseudo code
--doesn't work
SET Output.MRM.MyVar = "Hello World" || Output.MRM.MyVar;
--doesn't work
SET Output.MRM.MyVar = "Hello World" + Output.MRM.MyVar; |
|
Back to top |
|
 |
mgk |
Posted: Sat Jan 10, 2009 12:46 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hello.
If Output.MRM.MyVar is NULL (or not present) they the result of the concatenation will also be NULL, and in ESQL assigning NULL to a value deletes it. Try concatenating two string literals together if you want to prove to yourself that concatenation works
A couple of other points, string literals in ESQL are defined with single not double quotes, and the concatenation operator is || not +, so your ESQL
should look like:
Code: |
SET Output.MRM.MyVar = 'Hello World' || Output.MRM.MyVar; |
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 |
|
 |
mqjeff |
Posted: Sat Jan 10, 2009 1:04 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
mgk wrote: |
your ESQL
should look like:
Code: |
SET Output.MRM.MyVar = 'Hello World' || COALESCE(Output.MRM.MyVar,''); |
|
Fixed that for you, MGK. |
|
Back to top |
|
 |
mgk |
Posted: Sat Jan 10, 2009 2:14 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
 _________________ 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|