XPath Part 7
Home Up

 

XPath Part 8 ]

Fast, reliable data access for ODBC, JDBC, ADO.NET and XML
WSSC 2008: An event dedicated to SOA and Web Services Security
Need an expert for Java, XML and Web Services projects?
88x31 CTIX Logo - Clear Background
Got SOX compliance?
Movielink Logo 88x31
Business Intelligence with R&R ReportWorks
IBM eserver xSeries 306m 8849 - P4 3.4 GHz
Memory
PROLIANT BL20P G3 XEON 3.6G 2P
iTunes Logo 88x31-1

 

XPath Navigation Limits SQL/XML Databases (Part 7)

 

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 Defined

This 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;

 
Customer view 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 

Visit GridSummit.com (Grid Computing Knowledge Portal) Visit WebServicesSummit.com: XML and Web Services Portal

 

© 2008, Ken North Computing LLC, All rights reserved.

 

120x90
  Movielink Generic 120X90 Animated