Author |
Message
|
satya2481 |
Posted: Fri Mar 18, 2011 2:58 am Post subject: ESQL SELECT statement to get information from Input Message |
|
|
Disciple
Joined: 26 Apr 2007 Posts: 170 Location: Bengaluru
|
Hi All,
I am using WMB V6.1.0.7 toolkit and not understanding how to write SELECT query to get some information from the Input message. Below are the details...
Input Message
Code: |
<Information>
<Block>
<TranType>Debit</TranType>
<Amount>-110</Amount>
<Indicator>P</Indicator>
</Block>
<Block>
<TranType>Credit</TranType>
<Amount>3000</Amount>
<Indicator>P</Indicator>
</Block>
<Block>
<TranType>Credit</TranType>
<Amount>10</Amount>
<Indicator>1</Indicator>
</Block>
<Block>
<TranType>Debit</TranType>
<Amount>-3000</Amount>
<Indicator>2</Indicator>
</Block>
<Block>
<TranType>Credit</TranType>
<Amount>10</Amount>
<Indicator>2</Indicator>
</Block>
</Information> |
Requirement
Need to perform below operations
- Group the <Block> groups based on the <Indicator> tag value
- Check TranType of each group of same Indicator type. If there are pairs (TranType = Credit and Debit) then set a flag
- Select distinct Indicator values from all the <Block> groups
Can some one tell is it possible to use SELECT statement for this or not. If possible how to do ?
Thank You
satya |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Mar 18, 2011 3:07 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It is possible to run ESQL Select against InputRoot, because it is not a plain SQL Select statement and thus understands the message tree as well as database tables.
ESQL Select does not support Group By or Order By clauses, because it is not a plain SQL Select statement.
So is it possible to do what you want with ESQL Select? |
|
Back to top |
|
 |
satya2481 |
Posted: Fri Mar 18, 2011 3:31 am Post subject: |
|
|
Disciple
Joined: 26 Apr 2007 Posts: 170 Location: Bengaluru
|
Yes, even I have read that Group By, Order By, Distinct is not supported in ESQL SELECT...
So I was wondering if we can fulfil the requirement by any other means... not using any loopings....
Regards
Satya |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Mar 18, 2011 4:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What is the requirement to avoid loopings?
What is the advantage gained by using multiple deeply nested SELECT statements over a more clearly written loop? |
|
Back to top |
|
 |
satya2481 |
Posted: Sun Mar 20, 2011 10:34 pm Post subject: |
|
|
Disciple
Joined: 26 Apr 2007 Posts: 170 Location: Bengaluru
|
Quote: |
What is the requirement to avoid loopings? |
I feel SELECT is faster than looping or consumes less memory... Since we are running in a mainframe Broker environment the MIPS needs to be less...
Quote: |
What is the advantage gained by using multiple deeply nested SELECT statements over a more clearly written loop? |
I think above answer is also holds good here... |
|
Back to top |
|
 |
|