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 » How to concatenate two strings in ESQL?

Post new topic  Reply to topic
 How to concatenate two strings in ESQL? « View previous topic :: View next topic » 
Author Message
wmb_worker
PostPosted: Sat Jan 10, 2009 12:24 pm    Post subject: How to concatenate two strings in ESQL? Reply with quote

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
View user's profile Send private message
mgk
PostPosted: Sat Jan 10, 2009 12:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Sat Jan 10, 2009 1:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
mgk
PostPosted: Sat Jan 10, 2009 2:14 pm    Post subject: Reply with quote

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
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 » How to concatenate two strings in ESQL?
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.