TechNotes
Logic in DB
Beyond Java
Data Access
SOX
SQL/XML
Restructuring
Trees
Open Source
BizIntel
MySQL
Drivers
ODBC
JDBC
OLE DB
.NET
Podcast
SQL:2003
MS SQL 2005
XML DBs
XQuery
Webcast
XQuery
SQL:2003
MS SQL 2005
|
|
<<Prev 1 2 3
4 5 6 7 8
9
Next >>
XML Hierarchical View DefinedThis second SQLfX® beta example below demonstrates the creation of the XML Customer hierarchical view CustView using a Create
XML view statement. It uses the SQL hierarchical syntax addition of “Parent” for defining physical XML hierarchical structures. This physical view is transparently
transformed into an SQL Left Outer Join view similar to the one in the relational hierarchical processing example in Example 1.
|
Fast, reliable data access for ODBC, JDBC, ADO.NET and XML |
The transparent SQL view of XML indicated below in Example 2 models the XML data structure shown in standard XML. This allows seamless and unified joining between XML
and relational data structures. The SQL CustView is then invoked producing the structured XML result following it. It preserves its stored XML hierarchical data order
unless overridden by an SQL ORDER BY. Other physical view types such as IBM’s hierarchical IMS database are possible and can also be hierarchically integrated
seamlessly.
|
Example 1: CustView structure
CREATE XML CustView
Cust(
CustID Char(8),
CustStoreID Char(8)),
Invoice(
InvID Char(8),
InvCustID Char(8),
InvStatus Char(8)) Parent Cust,
Addr(
AddrID Char(8),
AddrCustID Char(8),
AddrState Char(8)) Parent Cust; 
 |
CustView |
Physical view CustView is transparently mapped into a SQL hierarchical view by same name.

SELECT CustID, InvID, AddrID
FROM CustView 
<root>
<cust custid="Cust01">
<invoice invid="Inv01"/>
<invoice invid="Inv02"/>
<addr addrid="Addr01"/>
</cust>
<cust custid="Cust02">
<invoice invid="Inv03"/>
<addr addrid="Addr02"/>
<addr addrid="Addr04"/>
</cust>
<cust custid="Cust03">
<addr addrid="Addr03"/>
</cust>
</root>
<< Prev 1 2
3 4 5 6 7
8 9 Next >>
Database Server Watch
SQL Summit Home
Page Articles
© 2008, Ken North Computing LLC, All rights
reserved.
|
|
|