IBM Books

XML Extender Administration and Programming

extractCLOB() and extractCLOBs()

Purpose

Extracts the element content or attribute value from an XML document and returns the data as CLOB type.

Syntax
Scalar function
>>-extractCLOB----(--xmlobj--,--path--)------------------------><
 
Table function
>>-extractCLOBs----(--xmlobj--,--path--)-----------------------><
 

Parameters

Table 35. extractCLOB and extractCLOBs function parameters
Parameter Data type Description
xmlobj
XMLVARCHAR,
XMLFILE, or
XMLCLOB

The column name.
path VARCHAR The location path of the element or attribute.

Return type

CLOB(10K)

Returned column name (table function)

returnedCLOB

Example

In this example, all of the part elements are extracted from a purchase order.

SELECT returnedCLOB as part 
   from table(db2xml.extractCLOBs(db2xml.XMLFile('c:\dxx\samples\xml\getstart.xml'), 
   '/Order/Part')) as x;


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