IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 2 replies
  • Latest Post - ‏2013-10-28T06:17:59Z by T.Amar
SyedImtiyazAlam
SyedImtiyazAlam
20 Posts

Pinned topic esql code

‏2013-10-27T12:04:12Z |

Hi,

Below are 2 types of input xml message.

1.

<test>

  <test1>
     <CC>cc</CC>
     <AUC>auc</AUC>
  </test1>
  <test1>
    <CC>cc</CC>
  </test1>
</test>

<test1> is repeating element and <AUC> is optional.

My Requirement : Need to check if <AUC> is there in the entire message or not.

i tried with SELECT statement but its not working. So at the end i used While loop. 

2. 

<test>
  <test1>
     <Values>
      <Name>AUC</Name>
      <Value>auc</Value>
    <Values>
    <Values>
      <Name>CC</Name>
      <Value>cc</Value>
    <Values>
  </test1>
  <test1>
    <Values>
      <Name>ASD</Name>
      <Value>asd</Value>
    <Values>
    <Values>
      <Name>CC</Name>
      <Value>cc</Value>
    <Values>
  </test1>
</test>

in this <test1> and inside it <Values> are repeating.

My Requirement : I need to check if the <Name> element has AUC or not in the entire message.for this also i tried with FOR statement to iterate with <test1> and then inside i used Select statement but didnot work.

 

Please suggest a best way to implement the above scenario.

 

Thanks in Advance

  • KY0J_Simbu_Selvarasu
    40 Posts

    Re: esql code

    ‏2013-10-28T03:30:16Z  

    Please post your select statement and also use usertrace to see what your select query doing with the message.

  • T.Amar
    T.Amar
    62 Posts

    Re: esql code

    ‏2013-10-28T06:17:59Z  

    Hi Syed,

     

    I'm also working on select statement but for the time being i can provide you an alternative.

    For

    1st XML

                 Take Reference to first Test1 and check field name of all its children and if not present go to next sibling of Test1.

    2nd XML

                 same as above but check for field value of <Name>.

    If you find with select stmt which can search for all sibling of Test1. please share it.

     

    Looking forward,

    T.Amar,

    amar.it1226@gmail.com