<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Extracting Master-Detail data from an XMLType with a single SQL statement</title>
	<atom:link href="http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/feed/" rel="self" type="application/rss+xml" />
	<link>http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement</link>
	<description></description>
	<lastBuildDate>Fri, 12 Apr 2013 10:04:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Marco Gralike</title>
		<link>http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/#comment-3985</link>
		<dc:creator>Marco Gralike</dc:creator>
		<pubDate>Sat, 06 Mar 2010 18:33:55 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1389#comment-3985</guid>
		<description><![CDATA[&lt;p&gt;Have a look at the following XMLTABLE with FOR ORIDINALITY example, where in this case the &quot;GrossDividentRate&quot; represents a repeating group of elements in the XML document and is passed as an XML fragment into the next XMLTABLE function:&lt;/p&gt;
&lt;p&gt;
&lt;code&gt;
&lt;pre&gt;
select xt2.gross_div_rate_cur_code   as &quot;CURRENCY_CODE&quot;
,      xt2.gross_div_rate_cur_amount as &quot;CURRENCY_AMOUNT&quot;
,      xt2.position                  as &quot;ELEMENT_POSITION&quot;
from   my_xmltable_store  cmt
,      xmltable(xmlnamespaces(default &#039;http://www.website.nl/ns/1.0&#039;),
                &#039;/ApplicationMessage&#039;
                passing cmt.object_value
                  GrossDividendRate         XMLTYPE      path &#039;CorporateActionDetails&#039;
                ) xt1
,      xmltable(xmlnamespaces(default &#039;http://www.website.nl/ns/1.0&#039;),
                &#039;/CorporateActionDetails/GrossDividendRate/*&#039;
                passing xt1.GrossDividendRate
                columns
                  POSITION FOR ORDINALITY,
                  gross_div_rate_cur_code    number(5)   path &#039;CurrencyCode&#039;,
                  gross_div_rate_cur_amount  varchar2(8) path &#039;Amount&#039;
                ) xt2
;
&lt;/pre&gt;&lt;/code&gt;

See for more info and howto&#039;s the Oracle OTN XMLDB forum and or my dedicated &lt;a href=&quot;http://blog.gralike.com&quot;  rel=&quot;nofollow&quot;&gt;XMLDB blog&lt;/a&gt;, besides my posts on XML DB on the technology.amis.nl blog.

HTH

Marco
&lt;/p&gt;
&lt;p&gt;Â &lt;/p&gt;]]></description>
		<content:encoded><![CDATA[<p>Have a look at the following XMLTABLE with FOR ORIDINALITY example, where in this case the &#8220;GrossDividentRate&#8221; represents a repeating group of elements in the XML document and is passed as an XML fragment into the next XMLTABLE function:</p>
<p>
<code></p>
<pre class="wp-code-highlight prettyprint">
select xt2.gross_div_rate_cur_code   as &quot;CURRENCY_CODE&quot;
,      xt2.gross_div_rate_cur_amount as &quot;CURRENCY_AMOUNT&quot;
,      xt2.position                  as &quot;ELEMENT_POSITION&quot;
from   my_xmltable_store  cmt
,      xmltable(xmlnamespaces(default &#039;<a href="http://www.website.nl/ns/1.0&#038;#039" rel="nofollow">http://www.website.nl/ns/1.0&#038;#039</a> <img src='http://technology.amis.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ,
                &#039;/ApplicationMessage&#039;
                passing cmt.object_value
                  GrossDividendRate         XMLTYPE      path &#039;CorporateActionDetails&#039;
                ) xt1
,      xmltable(xmlnamespaces(default &#039;<a href="http://www.website.nl/ns/1.0&#038;#039" rel="nofollow">http://www.website.nl/ns/1.0&#038;#039</a> <img src='http://technology.amis.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ,
                &#039;/CorporateActionDetails/GrossDividendRate/*&#039;
                passing xt1.GrossDividendRate
                columns
                  POSITION FOR ORDINALITY,
                  gross_div_rate_cur_code    number(5)   path &#039;CurrencyCode&#039;,
                  gross_div_rate_cur_amount  varchar2(8) path &#039;Amount&#039;
                ) xt2
;
</pre>
<p></code></p>
<p>See for more info and howto&#8217;s the Oracle OTN XMLDB forum and or my dedicated <a href="http://blog.gralike.com"  rel="nofollow">XMLDB blog</a>, besides my posts on XML DB on the technology.amis.nl blog.</p>
<p>HTH</p>
<p>Marco
</p>
<p>Â </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco Gralike</title>
		<link>http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/#comment-3984</link>
		<dc:creator>Marco Gralike</dc:creator>
		<pubDate>Sat, 06 Mar 2010 18:24:14 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1389#comment-3984</guid>
		<description><![CDATA[&lt;p&gt;Some good advice to all who read this post.&lt;/p&gt;
&lt;p&gt;Be aware that the propriety XSQL functions are getting deprecated from 11gR2 and onwards.&lt;/p&gt;
&lt;p&gt;The table(xmlsequence(extract())) syntax (XPath V1) should only be used in Oracle 1ogR1 and below.&lt;/p&gt;
&lt;p&gt;The optimized XMLTABLE function (XPath V2 and XQuery 1.0 compatible) should be used from Oracle 10gR2 and onwards. This functionality is (performance wise) optimized in 10gR2 and onwards while the older propriety functionality is maintained only.Â  XMLTABLE makes use of the XQuery engine introduced in Oracle 1ogR2.&lt;/p&gt;
&lt;p&gt;To answer KILE&#039;s question. Have a look at the FOR ORDINALITY syntax in XMLTABLE to sort out repeating groups/elements. InÂ  principal you can pass on the repeating group to a SECOND XMLTABLE function as a XML Fragment by choosing XMLTYPE as its datatype. In the second XMLTABLE function you refer in the PASSING clause to defined XMLTYPE column in the XMLTABLE function.&lt;/p&gt;
&lt;p&gt;You could do the same (passing on XML fragments) with the table(xmlsequence(extract())) construct via the &quot;position&quot; XPath function as an alternative for the FOR ORDINALITY, but I wouldn&#039;t advice this to be used in Oracle 10gR2. To make this more interesting. Officially, despite that it works, the &quot;position&quot; xpath function is not supported by Oracle in 10g and below...&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;...AND ALWAYS, ALWAYS try to use the full XPATH&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;Avoid, but better, NEVER USE WILDCARD&#039;s like &quot;*&quot; or &quot;//&quot;, if you favor performance. By giving the XML parser (or in some cases the Oracle Cost based Optimizer) only such hints to work with, the whole XML document will be searched. In effect this is very very very inefficient regarding memory and CPU use... You have been warned by someone who nowadays knows...

HTH

&lt;a href=&quot;http://www.liberidu.com/blog&quot; rel=&quot;nofollow&quot;&gt;Marco&lt;/a&gt;
Â &lt;/p&gt;]]></description>
		<content:encoded><![CDATA[<p>Some good advice to all who read this post.</p>
<p>Be aware that the propriety XSQL functions are getting deprecated from 11gR2 and onwards.</p>
<p>The table(xmlsequence(extract())) syntax (XPath V1) should only be used in Oracle 1ogR1 and below.</p>
<p>The optimized XMLTABLE function (XPath V2 and XQuery 1.0 compatible) should be used from Oracle 10gR2 and onwards. This functionality is (performance wise) optimized in 10gR2 and onwards while the older propriety functionality is maintained only.Â  XMLTABLE makes use of the XQuery engine introduced in Oracle 1ogR2.</p>
<p>To answer KILE&#8217;s question. Have a look at the FOR ORDINALITY syntax in XMLTABLE to sort out repeating groups/elements. InÂ  principal you can pass on the repeating group to a SECOND XMLTABLE function as a XML Fragment by choosing XMLTYPE as its datatype. In the second XMLTABLE function you refer in the PASSING clause to defined XMLTYPE column in the XMLTABLE function.</p>
<p>You could do the same (passing on XML fragments) with the table(xmlsequence(extract())) construct via the &#8220;position&#8221; XPath function as an alternative for the FOR ORDINALITY, but I wouldn&#8217;t advice this to be used in Oracle 10gR2. To make this more interesting. Officially, despite that it works, the &#8220;position&#8221; xpath function is not supported by Oracle in 10g and below&#8230;</p>
<p>
<strong>&#8230;AND ALWAYS, ALWAYS try to use the full XPATH</strong>.
</p>
<p>Avoid, but better, NEVER USE WILDCARD&#8217;s like &#8220;*&#8221; or &#8220;//&#8221;, if you favor performance. By giving the XML parser (or in some cases the Oracle Cost based Optimizer) only such hints to work with, the whole XML document will be searched. In effect this is very very very inefficient regarding memory and CPU use&#8230; You have been warned by someone who nowadays knows&#8230;</p>
<p>HTH</p>
<p><a href="http://www.liberidu.com/blog" rel="nofollow">Marco</a><br />
Â </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KILE</title>
		<link>http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/#comment-3983</link>
		<dc:creator>KILE</dc:creator>
		<pubDate>Sat, 06 Mar 2010 13:22:47 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1389#comment-3983</guid>
		<description><![CDATA[Hi,
I&#039;m using the following select to get the values of the items1 field:
SELECT EXTRACT (VALUE (xmltable0), &#039;//value/text()&#039;).getstringval () AS nombre_completo
 FROM TABLE i, TABLE (XMLSEQUENCE (EXTRACT (i.xml_informe, &#039;//main/items2/value&#039;))) xmltable0
Where a record from this table is:
&lt;main&gt;
 &lt;items1&gt;
 &lt;value&gt;3&lt;/value&gt;
 &lt;value&gt;5&lt;/value&gt;
 &lt;value&gt;6&lt;/value&gt;
 &lt;value&gt;7&lt;/value&gt;
 &lt;value&gt;8&lt;/value&gt;
 &lt;/items1&gt;
 &lt;items2&gt;
 &lt;value&gt;3&lt;/value&gt;
 &lt;value&gt;5&lt;/value&gt;
 &lt;value&gt;
 &lt;value&gt;1-7&lt;/value&gt;
 &lt;value&gt;1-8&lt;/value&gt;
 &lt;/value&gt;
 &lt;value&gt;7&lt;/value&gt;
 &lt;value&gt;8&lt;/value&gt;
 &lt;/items2&gt;
&lt;main&gt;
So I get 5 rows with values: 3 5 6 7 8.
My question is that sometimes I get more than 1 level of hierarchy, like in items2. How could be a good way to get it? I&#039;m a little lost about how to make it, so any help will be more than welcome.
Â 
Thank u very much in advance
Â 
Â ]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
I&#8217;m using the following select to get the values of the items1 field:<br />
SELECT EXTRACT (VALUE (xmltable0), &#8216;//value/text()&#8217;).getstringval () AS nombre_completo<br />
 FROM TABLE i, TABLE (XMLSEQUENCE (EXTRACT (i.xml_informe, &#8216;//main/items2/value&#8217;))) xmltable0<br />
Where a record from this table is:<br />
&lt;main&gt;<br />
 &lt;items1&gt;<br />
 &lt;value&gt;3&lt;/value&gt;<br />
 &lt;value&gt;5&lt;/value&gt;<br />
 &lt;value&gt;6&lt;/value&gt;<br />
 &lt;value&gt;7&lt;/value&gt;<br />
 &lt;value&gt;8&lt;/value&gt;<br />
 &lt;/items1&gt;<br />
 &lt;items2&gt;<br />
 &lt;value&gt;3&lt;/value&gt;<br />
 &lt;value&gt;5&lt;/value&gt;<br />
 &lt;value&gt;<br />
 &lt;value&gt;1-7&lt;/value&gt;<br />
 &lt;value&gt;1-8&lt;/value&gt;<br />
 &lt;/value&gt;<br />
 &lt;value&gt;7&lt;/value&gt;<br />
 &lt;value&gt;8&lt;/value&gt;<br />
 &lt;/items2&gt;<br />
&lt;main&gt;<br />
So I get 5 rows with values: 3 5 6 7 8.<br />
My question is that sometimes I get more than 1 level of hierarchy, like in items2. How could be a good way to get it? I&#8217;m a little lost about how to make it, so any help will be more than welcome.<br />
Â <br />
Thank u very much in advance<br />
Â <br />
Â </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhu</title>
		<link>http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/#comment-3982</link>
		<dc:creator>Madhu</dc:creator>
		<pubDate>Fri, 29 Jan 2010 02:50:07 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1389#comment-3982</guid>
		<description><![CDATA[Hey,

really a very useful article on XML DB. Easy to understand.]]></description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>really a very useful article on XML DB. Easy to understand.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arthur Johnson</title>
		<link>http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/#comment-3981</link>
		<dc:creator>Arthur Johnson</dc:creator>
		<pubDate>Mon, 22 Oct 2007 19:06:42 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1389#comment-3981</guid>
		<description><![CDATA[Resolved my question with SQL:
SELECT extractvalue(Value(a1), &#039;*/ProductReference&#039;) productreference,
extractvalue(Value(a1), &#039;*/SerialNumber&#039;) serialnumber,
extractvalue(Value(a1), &#039;*/Model&#039;) &quot;model&quot;,
extractvalue(Value(a1), &#039;*/Coverage&#039;) coverage,
extractvalue(Value(a1), &#039;*/CoverageStatus&#039;) coveragestatus,
extractvalue(Value(s1), &#039;*/CountryCode&#039;) countrycode,
extractvalue(Value(s1), &#039;*/CountryName&#039;) countryname,
extractvalue(Value(s1), &#039;*/CustomerName&#039;) customername,
extractvalue(Value(s1), &#039;*/CustomerNumber&#039;) customernumber,
extractvalue(Value(s1), &#039;*/SiteNumber&#039;) sitenumber,
extractvalue(Value(s1), &#039;*/SiteShortName&#039;) siteshortname,
extractvalue(Value(s1), &#039;*/Address1&#039;) address1,
extractvalue(Value(s1), &#039;*/Address2&#039;) address2,
extractvalue(Value(s1), &#039;*/City&#039;) city,
extractvalue(Value(s1), &#039;*/State&#039;) state,
extractvalue(Value(s1), &#039;*/PostalCode&#039;) postalcode,
extractvalue(Value(s1), &#039;*/Location&#039;) sitelocation,
extractvalue(Value(s1), &#039;*/SitePhoneNumber&#039;) sitephonenumber,
extractvalue(Value(s1), &#039;*/ContactName&#039;) contactname,
extractvalue(Value(s1), &#039;*/Contactphone&#039;) contactphone,
extractvalue(Value(s1), &#039;*/CSRCode&#039;) csrcode,
extractvalue(Value(s1), &#039;*/CSRName&#039;) csrname,
extractvalue(Value(s1), &#039;*/BranchCode&#039;) branchcode,
extractvalue(Value(s1), &#039;*/TerritoryCode&#039;) territorycode,
sdi.sdiid  as reqid
FROM aradmin.sdi_xml_tab sdi,
TABLE (xmlsequence (extract (sdidocxml, &#039;*/Assets/Asset&#039;))) a1,
TABLE (xmlsequence (extract (value(a1), &#039;*/Site&#039;))) s1

Thanks,
Arthur]]></description>
		<content:encoded><![CDATA[<p>Resolved my question with SQL:<br />
SELECT extractvalue(Value(a1), &#8216;*/ProductReference&#8217;) productreference,<br />
extractvalue(Value(a1), &#8216;*/SerialNumber&#8217;) serialnumber,<br />
extractvalue(Value(a1), &#8216;*/Model&#8217;) &#8220;model&#8221;,<br />
extractvalue(Value(a1), &#8216;*/Coverage&#8217;) coverage,<br />
extractvalue(Value(a1), &#8216;*/CoverageStatus&#8217;) coveragestatus,<br />
extractvalue(Value(s1), &#8216;*/CountryCode&#8217;) countrycode,<br />
extractvalue(Value(s1), &#8216;*/CountryName&#8217;) countryname,<br />
extractvalue(Value(s1), &#8216;*/CustomerName&#8217;) customername,<br />
extractvalue(Value(s1), &#8216;*/CustomerNumber&#8217;) customernumber,<br />
extractvalue(Value(s1), &#8216;*/SiteNumber&#8217;) sitenumber,<br />
extractvalue(Value(s1), &#8216;*/SiteShortName&#8217;) siteshortname,<br />
extractvalue(Value(s1), &#8216;*/Address1&#8242;) address1,<br />
extractvalue(Value(s1), &#8216;*/Address2&#8242;) address2,<br />
extractvalue(Value(s1), &#8216;*/City&#8217;) city,<br />
extractvalue(Value(s1), &#8216;*/State&#8217;) state,<br />
extractvalue(Value(s1), &#8216;*/PostalCode&#8217;) postalcode,<br />
extractvalue(Value(s1), &#8216;*/Location&#8217;) sitelocation,<br />
extractvalue(Value(s1), &#8216;*/SitePhoneNumber&#8217;) sitephonenumber,<br />
extractvalue(Value(s1), &#8216;*/ContactName&#8217;) contactname,<br />
extractvalue(Value(s1), &#8216;*/Contactphone&#8217;) contactphone,<br />
extractvalue(Value(s1), &#8216;*/CSRCode&#8217;) csrcode,<br />
extractvalue(Value(s1), &#8216;*/CSRName&#8217;) csrname,<br />
extractvalue(Value(s1), &#8216;*/BranchCode&#8217;) branchcode,<br />
extractvalue(Value(s1), &#8216;*/TerritoryCode&#8217;) territorycode,<br />
sdi.sdiid  as reqid<br />
FROM aradmin.sdi_xml_tab sdi,<br />
TABLE (xmlsequence (extract (sdidocxml, &#8216;*/Assets/Asset&#8217;))) a1,<br />
TABLE (xmlsequence (extract (value(a1), &#8216;*/Site&#8217;))) s1</p>
<p>Thanks,<br />
Arthur</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arthur Johnson</title>
		<link>http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/#comment-3980</link>
		<dc:creator>Arthur Johnson</dc:creator>
		<pubDate>Mon, 22 Oct 2007 16:56:14 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1389#comment-3980</guid>
		<description><![CDATA[I have a similar structured XML where I would like to display each Asset&#039;s tags and the Site tags for each Asset. when I run the query below, I get error- ORA-00904: &quot;ASSET&quot;: invalid identifier. What&#039;s wrong?

XML:
===
-
	+
	-
		-
			  ...
			  ...
			  ...
			  ...
			-
				  ...
				  ...
				  ...
				  ...
				  ...
				  ...
				  ...
				  ...
				  ...
				  ...
				  ...
				  ...
				  ...
				  ...
				  ...
				  ...


		  .
		  .
		  .

	  200
	  84


QUERY:
=====
SELECT extractvalue(Value(a1), &#039;*/ProductReference&#039;) productreference,
extractvalue(Value(a1), &#039;*/SerialNumber&#039;) serialnumber,
extractvalue(Value(a1), &#039;*/Model&#039;) &quot;model&quot;,
extractvalue(Value(a1), &#039;*/Coverage&#039;) coverage,
extractvalue(Value(a1), &#039;*/CoverageStatus&#039;) coveragestatus,
extractvalue(Value(s1), &#039;*/CountryCode&#039;) countrycode,
extractvalue(Value(s1), &#039;*/CountryName&#039;) countryname,
extractvalue(Value(s1), &#039;*/CustomerName&#039;) customername,
extractvalue(Value(s1), &#039;*/CustomerNumber&#039;) customernumber,
extractvalue(Value(s1), &#039;*/SiteNumber&#039;) sitenumber,
extractvalue(Value(s1), &#039;*/SiteShortName&#039;) siteshortname,
extractvalue(Value(s1), &#039;*/Address1&#039;) address1,
extractvalue(Value(s1), &#039;*/Address2&#039;) address2,
extractvalue(Value(s1), &#039;*/City&#039;) city,
extractvalue(Value(s1), &#039;*/State&#039;) state,
extractvalue(Value(s1), &#039;*/PostalCode&#039;) postalcode,
extractvalue(Value(s1), &#039;*/Location&#039;) sitelocation,
extractvalue(Value(s1), &#039;*/SitePhoneNumber&#039;) sitephonenumber,
extractvalue(Value(s1), &#039;*/ContactName&#039;) contactname,
extractvalue(Value(s1), &#039;*/Contactphone&#039;) contactphone,
extractvalue(Value(s1), &#039;*/CSRCode&#039;) csrcode,
extractvalue(Value(s1), &#039;*/CSRName&#039;) csrname,
extractvalue(Value(s1), &#039;*/BranchCode&#039;) branchcode,
extractvalue(Value(s1), &#039;*/TerritoryCode&#039;) territorycode,
sdi.sdiid  as reqid
FROM aradmin.sdi_xml_tab sdi,
TABLE (xmlsequence (extract (Asset, &#039;*/Assets&#039;))) a1,
TABLE (xmlsequence (extract (value(a1), &#039;*/Asset/Site&#039;))) s1]]></description>
		<content:encoded><![CDATA[<p>I have a similar structured XML where I would like to display each Asset&#8217;s tags and the Site tags for each Asset. when I run the query below, I get error- ORA-00904: &#8220;ASSET&#8221;: invalid identifier. What&#8217;s wrong?</p>
<p>XML:<br />
===<br />
-<br />
	+<br />
	-<br />
		-<br />
			  &#8230;<br />
			  &#8230;<br />
			  &#8230;<br />
			  &#8230;<br />
			-<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;<br />
				  &#8230;</p>
<p>		  .<br />
		  .<br />
		  .</p>
<p>	  200<br />
	  84</p>
<p>QUERY:<br />
=====<br />
SELECT extractvalue(Value(a1), &#8216;*/ProductReference&#8217;) productreference,<br />
extractvalue(Value(a1), &#8216;*/SerialNumber&#8217;) serialnumber,<br />
extractvalue(Value(a1), &#8216;*/Model&#8217;) &#8220;model&#8221;,<br />
extractvalue(Value(a1), &#8216;*/Coverage&#8217;) coverage,<br />
extractvalue(Value(a1), &#8216;*/CoverageStatus&#8217;) coveragestatus,<br />
extractvalue(Value(s1), &#8216;*/CountryCode&#8217;) countrycode,<br />
extractvalue(Value(s1), &#8216;*/CountryName&#8217;) countryname,<br />
extractvalue(Value(s1), &#8216;*/CustomerName&#8217;) customername,<br />
extractvalue(Value(s1), &#8216;*/CustomerNumber&#8217;) customernumber,<br />
extractvalue(Value(s1), &#8216;*/SiteNumber&#8217;) sitenumber,<br />
extractvalue(Value(s1), &#8216;*/SiteShortName&#8217;) siteshortname,<br />
extractvalue(Value(s1), &#8216;*/Address1&#8242;) address1,<br />
extractvalue(Value(s1), &#8216;*/Address2&#8242;) address2,<br />
extractvalue(Value(s1), &#8216;*/City&#8217;) city,<br />
extractvalue(Value(s1), &#8216;*/State&#8217;) state,<br />
extractvalue(Value(s1), &#8216;*/PostalCode&#8217;) postalcode,<br />
extractvalue(Value(s1), &#8216;*/Location&#8217;) sitelocation,<br />
extractvalue(Value(s1), &#8216;*/SitePhoneNumber&#8217;) sitephonenumber,<br />
extractvalue(Value(s1), &#8216;*/ContactName&#8217;) contactname,<br />
extractvalue(Value(s1), &#8216;*/Contactphone&#8217;) contactphone,<br />
extractvalue(Value(s1), &#8216;*/CSRCode&#8217;) csrcode,<br />
extractvalue(Value(s1), &#8216;*/CSRName&#8217;) csrname,<br />
extractvalue(Value(s1), &#8216;*/BranchCode&#8217;) branchcode,<br />
extractvalue(Value(s1), &#8216;*/TerritoryCode&#8217;) territorycode,<br />
sdi.sdiid  as reqid<br />
FROM aradmin.sdi_xml_tab sdi,<br />
TABLE (xmlsequence (extract (Asset, &#8216;*/Assets&#8217;))) a1,<br />
TABLE (xmlsequence (extract (value(a1), &#8216;*/Asset/Site&#8217;))) s1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Nuijten</title>
		<link>http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/#comment-3979</link>
		<dc:creator>Alex Nuijten</dc:creator>
		<pubDate>Thu, 30 Aug 2007 13:01:54 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1389#comment-3979</guid>
		<description><![CDATA[Thank you, Val for your comments. You can use xpath expressions to refer to attributes.
I&#039;ll put up an example in the body of the post (formatting issue in the comments section)]]></description>
		<content:encoded><![CDATA[<p>Thank you, Val for your comments. You can use xpath expressions to refer to attributes.<br />
I&#8217;ll put up an example in the body of the post (formatting issue in the comments section)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Val</title>
		<link>http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/#comment-3978</link>
		<dc:creator>Val</dc:creator>
		<pubDate>Thu, 30 Aug 2007 05:54:04 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1389#comment-3978</guid>
		<description><![CDATA[Thank you for writing this.  I do have a question - what if my XML file has only three tags and all the values are in attributes?  What&#039;s the syntax of selecting attribute values?]]></description>
		<content:encoded><![CDATA[<p>Thank you for writing this.  I do have a question &#8211; what if my XML file has only three tags and all the values are in attributes?  What&#8217;s the syntax of selecting attribute values?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Nuijten</title>
		<link>http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/#comment-3977</link>
		<dc:creator>Alex Nuijten</dc:creator>
		<pubDate>Thu, 12 Apr 2007 09:17:29 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1389#comment-3977</guid>
		<description><![CDATA[Thank you for your comments Steve. I put an answer to your question in the posting (it is not possible to properly format code in this section). Now that I reread your question I think I interpreted your question wrong. Maybe you don&#039;t want an outerjoin after all. If you don&#039;t want to see the kids without wishlist, but only the kids who do have a wishlist,  the queries as the were posted originally do that.]]></description>
		<content:encoded><![CDATA[<p>Thank you for your comments Steve. I put an answer to your question in the posting (it is not possible to properly format code in this section). Now that I reread your question I think I interpreted your question wrong. Maybe you don&#8217;t want an outerjoin after all. If you don&#8217;t want to see the kids without wishlist, but only the kids who do have a wishlist,  the queries as the were posted originally do that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://technology.amis.nl/2006/10/31/extracting-master-detail-data-from-an-xmltype-with-a-single-sql-statement/#comment-3976</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 10 Apr 2007 18:41:45 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1389#comment-3976</guid>
		<description><![CDATA[I&#039;ve been looking at a similar query, but always wondered how to do an inner join if the kids had no wishlist (hard to believe!), i.e. I don&#039;t want to see aa row at all if there is no wishlist for the child.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve been looking at a similar query, but always wondered how to do an inner join if the kids had no wishlist (hard to believe!), i.e. I don&#8217;t want to see aa row at all if there is no wishlist for the child.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
