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 handling of empty strings

Post new topic  Reply to topic
 ESQL handling of empty strings « View previous topic :: View next topic » 
Author Message
nize
PostPosted: Thu Oct 07, 2010 4:52 am    Post subject: ESQL handling of empty strings Reply with quote

Voyager

Joined: 02 Sep 2009
Posts: 90

I have the ESQL line

Code:

SET outputPointer.ns9:SubstitutionInformation.ns9:SubstitutedBySample.ns9:PartId = inputPointer.SUBSTITUTEDBY;


Sometimes the value of the field inputPointer.SUBSTITUTEDBY is empty. For these cases I would like that the field outputPointer.ns9:SubstitutionInformation.ns9:SubstitutedBySample.ns9:PartId is not even created. I achieve this by modifying the line as below:

Code:

         IF inputPointer.SUBSTITUTEDBY <> '' THEN
            SET outputPointer.ns9:SubstitutionInformation.ns9:SubstitutedBySample.ns9:PartId = inputPointer.SUBSTITUTEDBY;
         END IF;


Is there no prettier way of doing this?
Back to top
View user's profile Send private message
crossland
PostPosted: Fri Oct 08, 2010 1:31 am    Post subject: Reply with quote

Master

Joined: 26 Jun 2001
Posts: 248

Have a look at the COALESCE function.
Back to top
View user's profile Send private message
nize
PostPosted: Fri Oct 08, 2010 1:38 am    Post subject: Reply with quote

Voyager

Joined: 02 Sep 2009
Posts: 90

Yes, I considered that one, but
Code:

COALESCE(inputPointer.SUBSTITUTEDBY)

wouldn't return NULL when inputPointer.SUBSTITUTEDBY is equal to ''.
Back to top
View user's profile Send private message
Luke
PostPosted: Fri Oct 08, 2010 3:21 am    Post subject: Reply with quote

Centurion

Joined: 10 Nov 2008
Posts: 128
Location: UK

nize wrote:
Yes, I considered that one, but
Code:

COALESCE(inputPointer.SUBSTITUTEDBY)

wouldn't return NULL when inputPointer.SUBSTITUTEDBY is equal to ''.


NULLIF(inputPointer.SUBSTITUTEDBY, '')
Back to top
View user's profile Send private message
nize
PostPosted: Fri Oct 08, 2010 5:35 am    Post subject: Reply with quote

Voyager

Joined: 02 Sep 2009
Posts: 90

Thanks Luke! I will try that one. I guess this is implicitly used in the mapping node.
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 » ESQL handling of empty strings
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.