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 » String Concatenation in ESQL

Post new topic  Reply to topic
 String Concatenation in ESQL « View previous topic :: View next topic » 
Author Message
kishoreraju
PostPosted: Wed Jul 13, 2005 7:08 am    Post subject: String Concatenation in ESQL Reply with quote

Disciple

Joined: 30 Sep 2004
Posts: 156

When iam trying to execute below code

Declare cAppendStr char;

set cAppendStr=cAppendStr||'kishore Raju'


after exceuting the above statement i am getting NULL in cAppendStr.


is it default functionality of the esql.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jul 13, 2005 7:16 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://publib.boulder.ibm.com/infocenter/wbihelp/index.jsp?topic=/com.ibm.etools.mft.doc/ak01037_.htm

Quote:
In all cases, if either operand is NULL, the result is NULL.

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Jul 14, 2005 3:20 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Make use of COALESCE function.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
EddieA
PostPosted: Thu Jul 14, 2005 8:16 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Quote:
Make use of COALESCE function.

Not quite as easy, as I just found out.

COALESCE works great if the field/tag does not exist. But, if the field/tag is there, and has an empty value, then COALESCE leaves that empty value. Had to do a combination of IFNULL and COALESCE to catch everything.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Jul 14, 2005 9:50 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

That's true! You will need more functions to catch everything. In this particular example, the ESQL can be like this,

Code:

Declare cAppendStr char;
set cAppendStr=COALESCE(cAppendStr,'') || 'kishore Raju' ;


This will work fine if the cAppendStr is NULL. If it has empty value then ur approach is perfect!
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Fri Jul 15, 2005 3:55 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

EddieA wrote:
But, if the field/tag is there, and has an empty value, then COALESCE leaves that empty value.

Do you mean that the field has a value of '', or that the field has a value of NULL?

They aren't the same thing.

But a value of 'NULL' is not the same thing as a value of NULL either - although they are very hard to tell apart in a trace...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
EddieA
PostPosted: Fri Jul 15, 2005 11:57 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Yeah. NULL, 'NULL', and '' have bitten me in the past. Especially when you switch between the Input tree and the Environment tree.

No, in this case, I was doing this:
Code:
SET OutPutValue = COALESCE(InputBody.XMLDoc.InputField, ' ');  (That a blank there)

I got different results for:

1. <InputField/>
2. No InputField tag in XMLDoc

In the first case, it gave me back ''. In the second, the ' ' that I wanted.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
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 » String Concatenation 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.