In the remainder of this article, we show queries that use each of the preceding approaches. These queries operate on the following table named HOLDINGSXML. This table contains a column named USERID and a column named XMLCOL. For examples showing how to query XML stored as character data, assume that XMLCOL is a CLOB-typed column. For the rest of our examples, which show how to query XML stored in an XML column, assume that XMLCOL is an XML-typed column.
USERID ------ | XMLCOL ------ |
Jonathan | <HOLDINGS>
<SHARE COMPANY="Amazon.com, Inc."
USERID="Jonathan">3000</SHARE>
<SHARE COMPANY="eBay Inc." USERID="Jonathan">4000</SHARE>
<SHARE COMPANY="Int'l Business Machines C"
USERID="Jonathan">2500</SHARE>
<SHARE COMPANY="Progress Software"
USERID="Jonathan">23</SHARE>
</HOLDINGS>
|
Minollo | <HOLDINGS>
<SHARE COMPANY="Amazon.com, Inc."
USERID="Minollo">3000</SHARE>
<SHARE COMPANY="eBay Inc." USERID="Minollo">4000</SHARE>
<SHARE COMPANY="Lucent Technologies, Inc."
USERID="Minollo">40000</SHARE>
<SHARE COMPANY="Progress Software"
USERID="Minollo">4000000</SHARE>
</HOLDINGS>
|
... | ... |