Author |
Message
|
MQUser123 |
Posted: Fri Jun 18, 2004 11:22 am Post subject: Getting to a Tag using ESQL |
|
|
Novice
Joined: 28 Aug 2003 Posts: 18
|
Can someone please tell me how to get to the Quantity tag with qualifier of "OPEN" using ESQL.
<Add_PO>
- <QUANTITY qualifier="OPEN">
<VALUE>1</VALUE>
<NUMOFDEC>0</NUMOFDEC>
<SIGN>+</SIGN>
<UOM>PCS</UOM>
</QUANTITY>
- <QUANTITY qualifier="ORDERED">
<VALUE>1</VALUE>
<NUMOFDEC>0</NUMOFDEC>
<SIGN>+</SIGN>
<UOM>PCS</UOM>
</QUANTITY>
- <QUANTITY qualifier="RECEIVED">
<VALUE>0</VALUE>
<NUMOFDEC>0</NUMOFDEC>
<SIGN>+</SIGN>
<UOM>PCS</UOM>
</QUANTITY>
</Add_PO> |
|
Back to top |
|
 |
JT |
Posted: Fri Jun 18, 2004 11:39 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Try this:
Code: |
SET extractedValue = THE (SELECT ITEM T.VALUE from InputRoot.XML.Add_PO.QUANTITY[] AS T WHERE T.(XML.Attribute)qualifier = 'OPEN'); |
|
|
Back to top |
|
 |
kirani |
Posted: Fri Jun 18, 2004 11:42 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
You will need code similar to this,
Code: |
select A.* where
InputRoot.XML.Add_PO.QUANTITY[] as A
where A.(XML.Attribute)qualifier='OPEN'
|
For more info please refer to ESQL reference manual. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
MQUser123 |
Posted: Fri Jun 18, 2004 1:17 pm Post subject: |
|
|
Novice
Joined: 28 Aug 2003 Posts: 18
|
Thanks for the response. I am still getting some error though.
What I am trying to do is this:
Set the VALUE for QUANTITY with "Qualifier =OPEN" to 0 |
|
Back to top |
|
 |
kirani |
Posted: Fri Jun 18, 2004 1:50 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
In that case navigate the tree and search for the matching QUANTITY tag. When found, set the value for <VALUE> tag to 0. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
MQUser123 |
Posted: Mon Jun 21, 2004 6:33 am Post subject: |
|
|
Novice
Joined: 28 Aug 2003 Posts: 18
|
Thanks again for your response. But thats exactly what my question is:
How do I navigate to that particular QUANTITY tag and set the value of the VALUE of tag to 0. All the QUANTITY tags are exactly identical execpt the qualifiers which differentiates them. |
|
Back to top |
|
 |
martinrydman |
Posted: Tue Jun 22, 2004 3:35 am Post subject: |
|
|
 Centurion
Joined: 30 Jan 2004 Posts: 139 Location: Gothenburg, Sweden
|
Something like this:
WBIMB 5.0 Code:
Code: |
FOR Q AS OutputRoot.XML.Add_PO.QUANTITY[] DO
IF Q(XML.Attr)qualifier = 'OPEN' THEN
SET Q.VALUE = ...
END IF;
END FOR; |
HTH
/Martin |
|
Back to top |
|
 |
|