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 » COALESCE behaving strange

Post new topic  Reply to topic
 COALESCE behaving strange « View previous topic :: View next topic » 
Author Message
neo_revolution
PostPosted: Tue Jul 20, 2004 12:39 pm    Post subject: COALESCE behaving strange Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

I am using COALESCE function, something like below

SET OutputRoot.XML.(XML.Element)P = COALESCE(longDescription, 'NO DESCRIPTION AVAILABLE');

When 'longDescription' is NULL, COALESCE is returning a NULL value.

I can't understand why its not returning default text - 'NO DESCRIPTION AVAILABLE'

Am I doing anything different ?
Back to top
View user's profile Send private message Yahoo Messenger
kirani
PostPosted: Tue Jul 20, 2004 12:51 pm    Post subject: Reply with quote

Jedi Knight

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

How are you populating the longDescription in your code?
What is the output of above statement? Can you post output message?
Also, let us know your environment details.
_________________
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
neo_revolution
PostPosted: Tue Jul 20, 2004 12:58 pm    Post subject: Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

My input msg is XML.

SET longDescription =
InputRoot.XML.(XML.Element)XMI."XMI.content".MessageProcessingNodeType.MessageProcessingNode[i].(XML.Attribute)"longDescription";

What is the output of above statement? Can you post output message?
SET OutputRoot.XML.(XML.Element)P = COALESCE(longDescription, 'NO DESCRIPTION AVAILABLE');

The output is coming as NULL if longDescription is NULL.

I set my environment to 'ALL'
Back to top
View user's profile Send private message Yahoo Messenger
kirani
PostPosted: Tue Jul 20, 2004 1:28 pm    Post subject: Reply with quote

Jedi Knight

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

Try this,

DECLARE DESC CHAR;

Code:

IF ( longDescription is NULL)  THEN
   SET DESC = 'NO DESCRIPTION AVAILABLE';
ELSE
   SET DESC = InputRoot.XML.(XML.Element)XMI."XMI.content".MessageProcessingNodeType.MessageProcessingNode[i].(XML.Attribute)"longDescription";
END IF;

SET OutputRoot.XML.(XML.Element)P = DESC;

_________________
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
neo_revolution
PostPosted: Tue Jul 20, 2004 3:25 pm    Post subject: Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

Hi Kiran,

I am wondering why COALESCE is not working in this case?

Thanks
Back to top
View user's profile Send private message Yahoo Messenger
kirani
PostPosted: Tue Jul 20, 2004 3:47 pm    Post subject: Reply with quote

Jedi Knight

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

Well, that's what we are trying to find out. If you use above code and it works then there is something wrong with COALESCE function. If you get different results for above code then there is something wrong with the input data that might be causing this problem.

What version (and CSD) of WMQI/WBIMB you are using?
_________________
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
fschofer
PostPosted: Wed Jul 21, 2004 4:21 am    Post subject: Reply with quote

Knight

Joined: 02 Jul 2001
Posts: 524
Location: Mainz, Germany

Hi,
have you tried to run a debug trace of your flow => compute node.

Maybe there you can see what went wrong.

Greetings
Frank
Back to top
View user's profile Send private message Send e-mail
neo_revolution
PostPosted: Wed Jul 21, 2004 4:39 am    Post subject: Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

I did something like this,

IF(longDescription = '') THEN
SET description =
InputRoot.XML.(XML.Element)XMI."XMI.content".MessageProcessingNodeType.MessageProcessingNode[i].(XML.Attribute)"shortDescription";
END IF;

It worked. I am on WMQI 2.1 and CSD3.

Thanks.
Back to top
View user's profile Send private message Yahoo Messenger
neo_revolution
PostPosted: Wed Jul 21, 2004 5:11 am    Post subject: Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

Guys,

I figured it out. My 'longDescription' is being populated as empty string, its not null. So COALSCE is returning me the empty string.

Thanks Kiran and everyone.
Back to top
View user's profile Send private message Yahoo Messenger
solomita
PostPosted: Wed Dec 07, 2005 1:13 pm    Post subject: Similar Coalesce problem Reply with quote

Voyager

Joined: 06 May 2003
Posts: 94

I am having a problem with COALESCE. My ESQL was working a few months back but now I am back at the customer site and its not working. Here is the code:

SET OutputRoot.XML.event.detail.acars.(XML.Attribute)NextFixPos = COALESCE(InputBody.POS_LINE_2.NEXT_FIX_POS,'');

My messages now go to the failure queue which has me believing that it is not viewing my quotes as a blank but as NULL.

Any ideas?
_________________
IBM Certified Specialist - WebSphere MQ Integrator
IBM Certified System Administrator - WebSphere MQ V5.3
IBM Certified System Administrator - WebSphere Business Integration Message Broker V5
Back to top
View user's profile Send private message Yahoo Messenger
EddieA
PostPosted: Wed Dec 07, 2005 3:39 pm    Post subject: Reply with quote

Jedi

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

Quote:
My ESQL was working a few months back but now I am back at the customer site and its not working

What changed.

How do you know it's the Coalesce that's giving you the problems. What's the error/exception.

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
solomita
PostPosted: Wed Dec 07, 2005 4:22 pm    Post subject: Reply with quote

Voyager

Joined: 06 May 2003
Posts: 94

I had begun commenting out ESQL and when i had the COALESCE lines commented out, the flows ran. I have a copy of the flows and messages sets deployed on a box internal to my company and everything is working fine there. Not sure why it isn't at the customer site.
_________________
IBM Certified Specialist - WebSphere MQ Integrator
IBM Certified System Administrator - WebSphere MQ V5.3
IBM Certified System Administrator - WebSphere Business Integration Message Broker V5
Back to top
View user's profile Send private message Yahoo Messenger
EddieA
PostPosted: Wed Dec 07, 2005 5:56 pm    Post subject: Reply with quote

Jedi

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

EddieA wrote:
What's the error/exception.

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
solomita
PostPosted: Thu Dec 08, 2005 10:25 am    Post subject: Reply with quote

Voyager

Joined: 06 May 2003
Posts: 94

My messages were ending up on the failure queue. I started by commenting all the lines of ESQL and slowly releasing the lines until I got an error (our flow debugger is not working). After all the commenting was done lines similar to the one I mentioned above were the ones that were preventing the message from processing successfully. However...we do have an exact replica of this broker environment on an internal system and I checked it last night and it was working successfully. I brought my input messages over from that box internally to the site and its working now! I guess the input messages that were being used had invalid control characters embedded even though they looked identical.
_________________
IBM Certified Specialist - WebSphere MQ Integrator
IBM Certified System Administrator - WebSphere MQ V5.3
IBM Certified System Administrator - WebSphere Business Integration Message Broker V5
Back to top
View user's profile Send private message Yahoo Messenger
JT
PostPosted: Thu Dec 08, 2005 11:34 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

When you are unable to debug the code, rather than commenting out lines of ESQL, I highly recommend that you gain insight into the processing of your flow by using the available trace feature:

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/au14220_.htm?
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 » COALESCE behaving strange
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.