XML Extender Administration and Programming
Enabling an XML collection parses the DAD file to identify the tables and
columns related to the XML document, and records control information in the
XML_USAGE table. Enabling an XML collection is optional for:
- Decomposing an XML document and storing the data in new DB2 tables
- Composing an XML document from existing data in multiple DB2 tables
If the same DAD file is used for composing and decomposing, you can enable
the collection for both composition and decomposition.
You can enable an XML collection through the XML Extender administration
wizard, using the dxxadm command with the enable_collection option,
or you can use the XML Extender stored procedure dxxEnableCollection().
Use the following steps to enable an XML collection.
- Set up and start the administration wizard. See Starting the administration wizard for details.
- Click Work with XML Collections from the LaunchPad
window. The Select a Task window is displayed.
- Click Enable a Collection and then Next. The
Enable a Collection window is displayed.
- Select the name of the collection you want to enable in the
Collection name field from the pull-down menu.
- Type the DAD file name into the DAD file name field or click
... to browse for an existing DAD file.
- Optionally, type the name of a previously created table space in the
Table space field.
The table space will contain new DB2 tables generated for
decomposition.
- Click Finish to enable the collection and return to the
LaunchPad window.
- If the collection is successfully enabled, an Enabled collection is
successful message is displayed.
- If the collection is not successfully enabled, an error message is
displayed. Continue the preceding steps until the collection is
successfully enabled.
To enable an XML collection, enter the dxxadm command:
Syntax:
dxxadm enable_collection |
---|
>>-dxxadm---enable_collection---dbName---collection---DAD_file-->
>-----+-----------------+--------------------------------------><
'--t--tablespace--'
|
Parameters:
- dbName
- The name of the database.
- collection
- The name of the XML collection. This value is used as a parameter
for the XML collection stored procedures.
- DAD_file
- The name of the file that contains the document access definition
(DAD).
- tablespace
- An existing table space that contains new DB2 tables that were generated
for decomposition. If not specified, the default table space is
used.
Example: The following example enables a collection called
sales_ord in the database SALES_DB using the DB2 command shell. The DAD
file uses SQL mapping and can be found in DAD file: XML collection - SQL mapping.
dxxadm enable_collection SALES_DB sales_ord getstart.dad
After you enable the XML collection, you can compose or decompose XML
documents using the XML Extender stored procedures.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]