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 » NULL handling in ESQL

Post new topic  Reply to topic
 NULL handling in ESQL « View previous topic :: View next topic » 
Author Message
llaros
PostPosted: Tue Jan 22, 2008 10:21 am    Post subject: Reply with quote

Apprentice

Joined: 22 Jan 2008
Posts: 37

Hi everybody

I also have a problem with TDS parser & null handling.
My Data Element Separation is AllElementsDelimited.

I try to develop a flow which gets a message in XMLNSC format and writes output as a TDS1.

I want this flow to write abscent elements of my model as a null (null will be represented as '^' characeter in a bitstream) to the output TDS stream, and that this elements values will be distinctive from empty strings.

Now when I put a message like this:
<?xml version="1.0" encoding="ASCII"?>
<getCustomerAddress>
<customer>
<firstName>Jakub</firstName>
</customer>
<address>
<street>4th Avenue</street>
</address>
</getCustomerAddress>


The flow is writing this bitstream to the output:
{{Jakub;};{,,,,,,,,,;;;4th Avenue}}
where
; is a delimiter
, is a repeating separator
{ is a begining of a complex type indicator
} is a end of a complex type indicator

But I'd like the parser to produce:
{{Jakub;^};{^,^,^,^,^,^,^,^,^,^;^;^;4th Avenue}}

Is it possible?
I checked Nillable (logical) and (TDS1 Physical) NullLiteralValue '^' everywhere in the Editor.

Please tell me If I should create new topic for this.
I saw CVS examples already but there is no topic on null-handling.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jan 23, 2008 3:04 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

We would prefer it if you started a new thread and referenced this one, rather than appending to an old thread.

Your TDS null settings look correct. I think the problem is in the message tree. The XMLNSC parser will not create NULLs in the message tree, so it contains elements with a value of empty string. That is different from a NULL.

You need to replace the empty strings with an explicit null. The ESQL will look something like this ( not tested ):
Code:
IF FIELDVALUE(InputRoot.XMLNSC.rootTag.myField) = '' THEN
    SET OutputRoot.MRM.myField VALUE = NULL;
END IF;
I expect there are a couple of syntax errors in there, but you get the idea.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jan 23, 2008 3:35 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Thread split for neatness and clarity
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
llaros
PostPosted: Tue Jan 29, 2008 2:58 am    Post subject: Reply with quote

Apprentice

Joined: 22 Jan 2008
Posts: 37

Thanks for your advice. I managed to do that. During testing I noticed that empty strings in elements are treated as null
<elem1><value></value></elem1> is being parsed to:
{^};

and the absent xml elements are parsed to:
{};

(for me it is not intuitive but the most important fact is that it is distinct so the relation [XML->TDS->XML] is transitive.
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 » NULL handling 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.