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 >>
Relational Hierarchical View DefinedThis first SQLfX® beta example demonstrates the creation of the relational Employee logical hierarchical view EmpView
based on existing relational tables. This includes the Left Outer Join operation that models (via syntax) and defines (via semantics) the processing of the full
nonlinear hierarchical data structure which is shown in Example 1 below.
|
Fast, reliable data access for ODBC, JDBC, ADO.NET and XML |
The EmpView hierarchical view is then invoked in a SQLfX® query which automatically produces structured XML in its default attribute format. This view contains ON
clause linear data filtering by the addition of AND DpndCode=’D’ for the Dpnd node. This is comparable to XPath data filtering. The ON clause’s main use is to link
logical database objects like relation tables or model physical database objects such as XML elements into hierarchical structures.
|
Example 1: EmpView structure. CREATE VIEW EmpView AS
SELECT * FROM Emp
LEFT JOIN Dpnd ON EmpID=DpndEmpID
AND DpndCode=’D’
LEFT JOIN Eaddr ON EmpCustID=EaddrCustID; 
 |
EmpView |

SELECT EmpID, DpndID, EaddrID
FROM EmpView 
<root>
<emp empid="Emp01">
<dpnd dpndid="Dpnd01"/>
<eaddr eaddrid="Addr01"/>
</emp>
<emp empid="Emp02">
<eaddr eaddrid="Addr03"/>
</emp>
</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.
|
|
|