Sybase XML manual Generating a DAD file for IBM DB2, ™ To generate a DAD file for IBM DB2, 237

Models: XML

1 290
Download 290 pages 48.58 Kb
Page 249
Image 249

Chapter 5 Exchanging data with databases supporting XML

Generating a DAD file for IBM DB2

IBM DB2 v8.1 (or higher) is a database server with an add-in for XML storage and retrieval called IBM DB2 Extender. XML data (elements, attributes) are mapped to relational data (tables, columns) through Document Access Definition files (.DAD).

There are three types of DAD files:

Type of storage

Type of mapping

Description

Xcolumn

column

The Root element is mapped to a

 

 

table, and its attributes or child

 

 

elements are mapped to columns

 

 

identified by an XPath

Xcollection

SQL

The DAD file starts with a SQL

 

 

statement for the table mapped to

 

 

the Root element, and each child

 

 

element or attribute is mapped to a

 

 

column or a table name

Xcollection

RDB

A Relational Database node, with a

 

 

table and a column name, is

 

 

associated with each attribute or

 

 

child element of the Root element

 

 

 

An XML model targeted with DTD allows you to generate DAD files for IBM DB2. You need first to map an XML model to a PDM, then to attach the IBM DB2 DAD extended model definition to the mapped XML model, and finally (optional) to define extended attributes for global elements. Extended attributes specify the type of DAD file generated for each global element. The DAD file is generated with the DTD file and a SQL file for stored procedures.

Caution

The following procedure assumes you have a PDM open in the workspace and targeted with IBM DB2 UDB 8.x Common Server as DBMS.

If the PDM is not targeted with the proper DBMS, select DatabaseChange Current DBMS.

™To generate a DAD file for IBM DB2:

1 In the PDM menu bar, select ToolsXML Builder Wizard.

XSM User's Guide

237

Page 249
Image 249
Sybase XML manual Generating a DAD file for IBM DB2, ™ To generate a DAD file for IBM DB2, 237