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.
You do not specify a length when you define an XML column. There is no architectural limit on the size of an XML value in a database. However, textual XML data that is exchanged with a Db2 database is limited to 2 GB-1, so the effective limit of an XML column is 2 GB-1.
Like a LOB column, an XML column holds only a descriptor of the column. The data is stored separately.
When you define an XML column, you can add an XML type modifier. An XML type modifier associates a set of one or more XML schemas with the XML data type. You can use an XML type modifier to cause all XML documents that are stored in an XML column to be validated according to one of the XML schemas that is specified in the type modifier.
When you create a table with an XML column in a universal table space, Db2 maintains multiple versions of XML documents during update operations, to enhance concurrency and memory usage.
CREATE TABLE CUSTOMER (CID BIGINT NOT NULL PRIMARY KEY,
INFO XML,
HISTORY XML)
CREATE TABLE PURCHASEORDERS(
ID INT NOT NULL,
CONTENT XML(XMLSCHEMA ID SYSXSR.PO1))