Escolar Documentos
Profissional Documentos
Cultura Documentos
Manfred Pler
IBM Datamanagement
mpaessle@us.ibm.com
Agenda
XML and DB2
XML Extender Overview
Storage and Access of XML Documents
XML Processing of Relational Data
Other Features
Conclusions
File System
Application
Program
DAD
(Data Access
Definition)
XML
DOC
DB2 XML
Extender
XML
Files
DB2
DAD
(Data Access
Definition)
Application
DB2 UDB
DB2 XML
Extender
XML
Collection
XML
Column
user table
book
XML
DOC
Client
DB2
CAE
DB2
Server
XML Extender
Client
XML Extender
Server
Admin
GUI
Stored
procedures
Utilities
UDFs
XML
Parser
Admin
Command
10
11
12
order
355 ...
356 ...<Order>...<Part>...<ExtendedPrice>1000</...
357 ...
Select
db2xml.extractDouble(order,'/Order/Part/ExtendedPrice')
from order_tab where invoice_number = 356
<book><chapter id="1">...</...><footnote id="2">...</...
Select * from table(db2xml.extractIntegers(
db2xml.XMLFile('c:\dxx\samples\xml\book1.xml'),
'/book/*/@id')) as x;
Xu and Cheng, Pler
13
<order key='99'>
<customer>Thompson</customer>
<part key='82'> .... </part>
<part key='83'> .... </part>
</order>
DAD
(Data Access
Definition)
Sales_tab
...
Order
(XMLCLOB)
...
side tables
order_tab
order_key customer
...
...
99
Thompson
part_tab
part_key
....
82
....
83
....
14
15
XML Processing of
Relational Data
16
99
customer
Thompson
compostion/decomposition)
part_tab
order_tab
order_key
order_key
part_key
....
99
82
....
99
83
....
17
18
Dynamic Mapping
Ability to take DAD to generate or shred XML
documents, where DAD can be created by
applications on the fly.
Change query criteria by overriding query condition
for document generation
SQL_OVERRIDE:
replace the SQL query
change conditions in the WHERE clause
designed for DBMS experts
XML_OVERRIDE:
Use XPath syntax to define element or attribute,
Specify the constraints on XML elements or
attributes on the documents to be generated
An example:
/department/@id
= 'E01'
AND
/department/name = 'John Duo'
Xu and Cheng, Pler
19
20
Other Features
21
Other Features
DTD Repository
Store your DTDs in DB2
One DTD can be referenced by many XML
documents and more than one XML column and
XML collection.
Use DTDID to validate input XML documents at
the insertion time
Validating Input or Generated XML Documents
Validation can be specified in your DAD,
Supported in both XML Column and Collection
features
GUI based Administration Tool
Help enabling your database, tables, columns,
and collections for XML
Help creating DADs
Xu and Cheng, Pler
22
Conclusions
23
24
25
Availability
Shipped as part of the DB2 Family
Platforms:
AIX, NT, Solaris, Lnix Shiped with DB2 UDB V7.1
AS/400 and OS/390 will be available soon
Web site
http://www.software.ibm.com/data/db2/
extenders/xmlext/index.html
Contact DB2XML@us.ibm.com for more
information
26