You can use the pureXML® XML data type to define table columns so that you can store a single, well-formed XML document in each row. This tutorial demonstrates how to set up a DB2® database to store XML data and to perform basic operations with the pureXML feature.
Application programming languages such as C++, Java™, and PHP support the XML data type. You can write applications to store XML data in DB2 databases tables, retrieve data from tables, or call stored procedures or user-defined functions with XML parameters. For information about application programming language support, see the related reference at the end of this topic.
This tutorial is written for a single-partition database environment, however you can also use the pureXML feature in a partitioned database environment. See the related links for information about using pureXML in a partitioned database environment.
In a DB2 command window, start the DB2 command-line processor by issuing the db2 -td~ command, the db2 command with the -td~ option.1
The -td option sets the tilde (~) as the statement termination character. Specifying a termination character other than the default semicolon (-t option) ensures that statements or queries that use namespace declarations are not misinterpreted, because namespace declarations are also terminated by a semicolon. The examples throughout this tutorial use the ~ termination character.
You can enter or copy and paste the examples in the lessions into the DB2 command-line processor, in interactive mode.