When storing typed XML you first will need to load an XML sc

When storing typed XML, you first will need to load an XML schema in the database before you can use it, and have schema validation in variables, columns, and expressions. Why is this important and how do you accomplish it?

Solution

The typed XML , is important to store and load in an XML schema because, it allows us to store well formed XML documents in table columns that have the XML data type. . By storing XML data in XML columns, the data is kept in its native hierarchical form, rather than stored as text or mapped to a different data model. Because pureXML data storage is fully integrated, the stored XML data can be accessed and managed by leveraging existing DB2 data server functionality. The storage of XML data in its native hierarchical form enables efficient search, retrieval, and updates of XML. XQuery, SQL, or a combination of both can be used to query and update XML data. SQL functions that return XML data or take XML arguments (referred to as SQL/XML functions) also enable XML data to be constructed or published from values retrieved from the database.

The XML data type is used to define columns of a table that store XML values, where all stored XML values must be well-formed XML documents. The introduction of this native XML data type provides the ability to store well-formed XML documents in their native hierarchical format in the database alongside other relational data. XML values are processed in an internal representation that is not a string and not directly comparable to string values. An XML value can be transformed into a serialized string value representing the XML document using the XMLSERIALIZE function or by binding the value to an application variable of an XML, string, or binary type. Similarly, a string value that represents an XML document can be transformed to an XML value using the XMLPARSE function or by binding an application string, binary, or XML application type to an XML value. In SQL data change statements (such as INSERT) involving XML columns, a string or binary value that represents an XML document is transformed into an XML value using an injected XMLPARSE function. An XML value can be implicitly parsed or serialized when exchanged with application string and binary data types.

When storing typed XML, you first will need to load an XML schema in the database before you can use it, and have schema validation in variables, columns, and e

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site