Wrox Programmer Forums
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 8th, 2011, 11:58 AM
Authorized User
 
Join Date: Sep 2009
Posts: 30
Thanks: 9
Thanked 0 Times in 0 Posts
Default XQuery filter

Hello,

How to filter the node based on specif condition? I have this data in database table (ID int ,data XML)

<MyData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Summary>
<GeneralInfo>
<Name>Organization1</Name>
<Country>India</Country>
</GeneralInfo>
<List>
<Summary>
<P_Name>Merry</P_Name>
<Costing>200</Costing>
<DataList1>
<Data>
<Type1>R01</Type1>
<Type2>R02</Type2>
<Type3>R03</Type3>
<Type4>R04</Type4>
<Type5>R05</Type5>
</Data>
<Data>
<Type6>R06</Type6>
<Type7>R07</Type7>
<Type8>R08</Type8>
<Type9>R09</Type9>
</Data>
</DataList1>
<DataList2>
<Data>
<Type1>R10</Type1>
<Type2>R11</Type2>
<Type3>R12</Type3>
<Type4>R13</Type4>
<Type5>R14</Type5>
</Data>
<Data>
<Type6>R15</Type6>
<Type7>R16</Type7>
<Type8>R18</Type8>
<Type9></Type9>
<Type10></Type10>
</Data>
</DataList2>
</Summary>
<Summary>
<P_Name>John</P_Name>
<Costing>200</Costing>
<DataList1>
<Data>
<Type1>R18</Type1>
<Type2>R19</Type2>
<Type3>R20</Type3>
<Type4>R21</Type4>
<Type5>R22</Type5>
</Data>
<Data>
<Type6>R23</Type6>
<Type7>R24</Type7>
<Type8>R25</Type8>
<Type9>R26</Type9>
</Data>
</DataList1>
<DataList2>
<Data>
<Type1>R28</Type1>
<Type2>R29</Type2>
<Type3>R30</Type3>
<Type4>R31</Type4>
<Type5>R32</Type5>
</Data>
<Data>
<Type6>R33</Type6>
<Type7>R34</Type7>
<Type8>R35</Type8>
<Type9>R36</Type9>
<Type10>R37</Type10>
</Data>
</DataList2>
</Summary>
</List>
</Summary>
</MyData>

I have to filiter the data for Specific ID from the table and P_Name is John. I wish to retrive data for Type1 and Type6

How toacheve this with XQUERY?

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with XQuery nelly78 XML 1 January 20th, 2010 07:10 PM
Problem with XQuery nelly78 BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 0 January 20th, 2010 04:50 PM
security on Xquery Tomi XSLT 3 May 7th, 2007 07:34 AM
How to get a XQuery.msi ? goldensaying XML 1 December 13th, 2006 01:01 PM
XQuery sonicDace XML 2 March 19th, 2004 05:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.