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 » V5 NULLIF treatment of spaces

Post new topic  Reply to topic
 V5 NULLIF treatment of spaces « View previous topic :: View next topic » 
Author Message
whytec
PostPosted: Tue Mar 14, 2006 4:10 pm    Post subject: V5 NULLIF treatment of spaces Reply with quote

Apprentice

Joined: 28 Nov 2005
Posts: 26
Location: Brisbane Australia

I've been doing some testing with WMB5 with the following statement:

Quote:
SET OutputRoot.XML.TestOutput.Output1 = COALESCE(NULLIF(InputBody.TestInput.Input1, ''), NULLIF(InputBody.TestInput.Input2, ''), 'AllNull');


Both of the NULLIF statements are testing the associated tag against an empty string.

One of the tests involves the following input XML (each tag contains one space character):

Quote:
<TestInput>
<Input1> </Input1>
<Input2> </Input2>
</TestInput>


The output I am getting is:

Quote:
<TestOutput>
<Output1>AllNull</Output1>
</TestOutput>


Am I correct in assuming that the NULLIF statement is doing an implicit TRIM on the contents of the first argument? In the past I've always used a TRIM statement in my code when I wanted to check if there were actual characters other than spaces in a tag, but now it seems that it was an unecessary step.

Example:
Quote:
SET someoutputtag = COALESCE(NULLIF(TRIM(someinputtag), ''), 'somedefaultvalue');


Anyone else found this? Does anyone know whether this also the case with WMQI2.1? I will do some extra testing with tags containing values with leading and trailing spaces and also tags containing two or more spaces.
Back to top
View user's profile Send private message
vk
PostPosted: Tue Mar 14, 2006 7:40 pm    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

XML elements having spaces alone without any other values will be trimmed automatically in WMQI 2.1 also.

For TDS message sets, trimming os spaces is based on the property Trim Fix Length String at the message set level. If the property is set to Trim Both, leading and training spaces will be removed.

Regards,
VK.
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 » V5 NULLIF treatment of spaces
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.