DB2 10.5 for Linux, UNIX, and Windows
Inserting XML data
Before you can insert XML documents, you must create a table that contains an XML column, or add an XML column to an existing table.
- Creation of tables with XML columns
To create tables with XML columns, you specify columns with the XML data type in the CREATE TABLE statement. A table can have one or more XML columns. - Addition of XML columns to existing tables
To add XML columns to existing tables, you specify columns with the XML data type in the ALTER TABLE statement with the ADD clause. A table can have one or more XML columns. - Insertion into XML columns
To insert data into an XML column, use the SQL INSERT statement. The input to the XML column must be a well-formed XML document, as defined in the XML 1.0 specification. The application data type can be an XML, character, or binary type. - XML parsing
XML parsing is the process of converting XML data from its serialized string format to its hierarchical format. - XML data integrity
When you need to ensure that your XML documents adhere to certain rules or fulfill certain processing requirements, you can perform additional XML data integrity checks or specify additional conditions that must be met before an action is performed. - Guidelines for using XML in a non-Unicode database
The pureXML® feature enables you to store and retrieve XML data from a database even when that database does not use a Unicode code page. This topic provides guidance on how to store XML data safely in this situation, in order to minimize any possibility of data corruption or loss.
Related concepts:
Related reference:
Related information: