Information Technology Reference
In-Depth Information
Fig. 6.10 Process for SQL to XQL transformation
Step 2 Create the SQL Query Graph
Based on the relation-list and the join-condition in the SQL query transaction, the
SQL query graph is created. The join condition is based on the natural join or based
on the search condition specified in the SQL query.
Step 3 Map the SQL Query Graph to XPath Query Graph
The SQL query graph is mapped to the XPath query graph. The table joins from the
SQL query graph forms the XPath location path, which are the steps for navigating
down the document tree from root node.
Step 4 Transform SQL to XPath Query
In this step, the SQL query is transformed into XPath syntax as follows:
URRWQRGH>#DWWULEXWH FRQGLWLRQ@«QRGH>#DWWULEXWH FRQGLWLRQ@
#DWWULEXWH
The attribute-list in the SQL query is mapped to the leaf attribute node at the bottom
of the document tree. If all the attributes of the element node are selected, “@*” is
mapped to select all the attributes from the leaf element node. If more than one at-
tributes are selected, the union operator is used to get the result. For example:
URRWQRGH#DWWULEXWH_URRWQRGH#DWWULEXWH
Search WWH ::




Custom Search