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 » Doubt regarding Null checks in ESQL

Post new topic  Reply to topic
 Doubt regarding Null checks in ESQL « View previous topic :: View next topic » 
Author Message
shushruthkumar
PostPosted: Wed May 05, 2021 3:48 am    Post subject: Doubt regarding Null checks in ESQL Reply with quote

Newbie

Joined: 05 May 2021
Posts: 2

Hi,

I am doing one of the Null checks for the Rest API being developed.

ESQl code :

IF COALESCE(InputLocalEnvironment.HTTP.Input.QueryString.accountId) IS NOT NULL THEN

SET OutputRoot.JSON.Data.accountId = InputLocalEnvironment.HTTP.Input.QueryString.accountId;
...........

In above condition I am doing the null check for query param of a Rest Service.
while hitting a service from postman, I am passing the query param value as NULL

here the above condition should fail right, as coalesce will retrun NULL and NULL is NOT NULL should fail right but here the condition is getting executed as true and going through IF and retruning the result.

Can anyone suggests me here?
Back to top
View user's profile Send private message
timber
PostPosted: Wed May 05, 2021 6:41 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

The answer is here: https://www.ibm.com/docs/en/integration-bus/10.0?topic=functions-coalesce-function
Back to top
View user's profile Send private message
timber
PostPosted: Thu May 06, 2021 9:13 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Looking at this again, I suspect the answer might be more complex than I thought. Two important questions:
- Why are you using COALESCE with only 1 argument? Why not just test for IS NOT NULL directly?
- More importantly, how exactly are you passing the value NULL via Postman? Have you checked (in the debugger, or using a Trace node) that the value NULL is being received in your message flow?
Back to top
View user's profile Send private message
rekarm01
PostPosted: Fri May 07, 2021 10:04 am    Post subject: Re: Doubt regarding Null checks in ESQL Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

timber wrote:
Have you checked (in the debugger, or using a Trace node) that the value NULL is being received in your message flow?

Also, enabling a debug-level usertrace may be useful.
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 » Doubt regarding Null checks 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.