IBM Version 5 Universal Remote User Manual


 
Chapter 6. RDB and XML integration 137
Figure 6-16 XML Collection mapping scheme
By analyzing the mapping scheme we will be able to determine whether we can
compose the entire XML document with one SQL statement or not. You can use
one of the two types of mapping schemes when defining a collection in the DAD
file:
SQL mapping. SQL mapping uses SQL SELECT statement to define the DB2
tables and conditions used for composing a document from the collection.
RDB_node mapping. RDB_node mapping uses an XPath-based relational
database node (RDB_node). The RDB_node has child elements that define
the tables, columns, and conditions used to associate XML data with DB2
tables.
SQL mapping
Defining a DAD file with SQL mapping scheme allows direct mapping from
relational data to XML documents through a single SQL statement and the
XPath
data model
. When working with SQL mapping it is important to understand the
following points:
SQL mapping scheme can be used for composition, not for decomposition.
root_node
element_node
Employee
element_node
Proj
attribute_node
EmpNo
EMPNO
element_node
StartDate
text_node
EMSTDATE
element_node
ProjNo
text_node
PROJNO
element_node
dept
text_node
WORKDEPT
element_node
Name
element_node
lastName
text_node
LASTNAME
element_node
firstName
text_node
FIRSTNAME
Names of columns in DB2 tables:
for example, EMPNO is a column in EMPLOYEE
table in SAMPLE database