IBM Books

XML Extender Administration and Programming


Searching XML documents

Searching XML data is similar to retrieving XML data: both techniques retrieve data for further manipulation but they search by using the WHERE clause to define predicates as the criteria of retrieval.

The XML Extender provides several methods for searching XML documents in an XML column, depending on your application's needs. It provides the ability to search document structure and return results based on element content and attribute values. You can search a view of the XML column and its side tables, directly search the side tables for better performance, or use extracting UDFs with WHERE clauses. Additionally, you can use the DB2 Text Extender and search column data within the structural content for a text string.

With the XML Extender you can use indexes on side table columns, which contain XML element content or attribute values that are extracted from XML documents, for high-speed searching. By specifying the data type of an element or attribute, you can search on SQL general data type or do range searches. For example, in our purchase order example, you could search for all orders that have an extended price of over 2500.00.

Additionally, you can use the DB2 UDB Text Extender to do structural text search or full text search. For example, you could have a column RESUME that contains resumes in XML format. You might want the name of all applicants who have Java skills. You could use the DB2 Text Extender to search on the XML documents for all resumes where the <skill> element contains the character string JAVA.

The following sections describe search methods:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]