Author |
Message
|
venuprsd |
Posted: Thu Apr 28, 2011 12:00 pm Post subject: How to check null values in XML message from the ESQL |
|
|
Apprentice
Joined: 15 Aug 2010 Posts: 44
|
Hello Experts,
I am having XML data. From that I am getting one null tag. If any one of the TAG is null i need to some operation.
for ex:
<x>123</x>
<y></y>
<z>567</z>
From the above Y tag is null.How can i check that from the ESQL.I used FIELDTYPE, FILED VALUE but not working.Could you please help me because this is urgent deliverable.
Thank you. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Apr 28, 2011 12:25 pm Post subject: Re: How to check null values in XML message from the ESQL |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
venuprsd wrote: |
From the above Y tag is null.How can i check that from the ESQL. |
Well I'd have thought something like this utterly untested segment:
Code: |
IF InputRoot.XMLNSC.y IS NULL THEN
|
would work, depending on if the tag is null or empty. You could also use LENGTH(FIELDVALUE(y)) > 0
(I assume you didn't actually try to use a function called FILED VALUE...) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Fri Apr 29, 2011 2:56 am Post subject: Re: How to check null values in XML message from the ESQL |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
venuprsd wrote: |
From the above Y tag is null. |
Really? I thought it was the empty string. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Apr 29, 2011 5:33 am Post subject: Re: How to check null values in XML message from the ESQL |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
WMBDEV1 wrote: |
venuprsd wrote: |
From the above Y tag is null. |
Really? I thought it was the empty string. |
You too eh??  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 29, 2011 10:54 am Post subject: Re: How to check null values in XML message from the ESQL |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Vitor wrote: |
WMBDEV1 wrote: |
venuprsd wrote: |
From the above Y tag is null. |
Really? I thought it was the empty string. |
You too eh??  |
Maybe someone could explain the VALUE of this debate. |
|
Back to top |
|
 |
flahunter |
Posted: Mon May 02, 2011 6:24 pm Post subject: Re: How to check null values in XML message from the ESQL |
|
|
 Acolyte
Joined: 30 Oct 2008 Posts: 62
|
Quote: |
From the above Y tag is null |
I don't think so. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon May 02, 2011 8:33 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It all depends on your definition of null and if you consider the 4 following cases to be equivalent:
Code: |
<mntag/>
<mntag></mntag>
<mntag xsi:nil="true" />
<mntag xsi:nil="true"></mntag>
|
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mattfarney |
Posted: Tue May 03, 2011 4:33 pm Post subject: |
|
|
 Disciple
Joined: 17 Jan 2006 Posts: 167 Location: Ohio
|
I think you want to use:
Code: |
IF FIELDVALUE(InputRoot.XMLNSC.y) IS NULL THEN
**do something**
|
-mf |
|
Back to top |
|
 |
|