Databases Reference
In-Depth Information
per document. With very few exceptions, this is acceptable for all XML
applications.
You can use the XML type not only as a column type but also as a data type for
host variables in languages such as C, Java, and COBOL. XML type is also
allowed for parameters and variables in SQL stored procedures, user defined
functions (UDFs), and externally stored procedures written in C and Java.
An application can manage XML documents in the best way suited for the
application. These ways include shredding XML data into relational tables or just
storing them as CLOBs. In DB2 pureXML, XML data is stored in a parsed,
annotated tree form, similar to (but distinct from) the Document Object Model
(DOM). The XML data is formatted to data pages, which are buffered. The
benefits of this format include faster navigation, which results in faster query
execution as well as simpler indexing of data. Figure 2-3 shows a DB2 CREATE
TABLE statement with XML data type, and how relational and XML data is stored
in DB2.
Figure 2-3 Creating table with XML data type
Throughout this chapter, we have used examples of XML data, relational data,
XQueries, SQL queries, and so on. These examples are based on Movie data.
The examples might not be entirely consistent because they were produced to
illustrate specific points made in the text and they might not be always complete.
The actual XML data and steps to create them in your environment have been
Search WWH ::




Custom Search