Purpose
Extracts the element content or attribute value from an XML document and returns the data as CHAR type.
Syntax
Scalar function |
---|
>>-extractChar----(--xmlobj--,--path--)------------------------>< |
Table function |
---|
>>-extractChars----(--xmlobj--,--path--)----------------------->< |
Parameters
Table 33. extractChar and extractChars 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
CHAR
Returned column name (table function)
returnedChar
Example
In the following example, the value of Color is extracted as CHAR.
SELECT * from table(db2xml.extractChars(Order, ('c:\dxx\samples\xml\getstart.xml'), '/Order/Part/@Color')) as x;