IBM Books

XML Extender Administration and Programming

The scenario

You have been given the task of archiving sales data for the service department. The data is stored in XML documents that use the same DTD. The service department will use these XML documents when working with customer requests and complaints.

The service department has provided a recommended structure for the XML documents and specified which element data they believe will be queried most frequently. They would like the XML documents stored in the SALES_TAB table in the SALES_DB database and want be able to search them quickly. The SALES_DB table will contain two columns with data about each sale, and a third column to contain the XML document. This column is called ORDER.

You will determine the XML data types in which to store the XML document, as well as which XML elements and attributes will be frequently queried. Next, you will set up the SALES_DB database for XML, create the SALES_TAB table, and enable the ORDER column so that you can store the intact document in DB2. You will also insert a DTD for the XML document for validation and then store the document as an XMLVARCHAR data type. When you enable the column, you will define side tables to be indexed for the structural search of the document in a document access definition (DAD) file, an XML document that specifies the structure of the side tables. To see samples of the DAD file, the DTD, and the XML document, see Appendix B, Samples.

The SALES_TAB is described in Table 1.

Table 1. SALES_TAB table
Column name Data type
INVOICE_NUM CHAR(6) NOT NULL PRIMARY KEY
SALES_PERSON VARCHAR(20)
ORDER XMLVARCHAR


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]