Purpose
Extracts the element content or attribute value from an XML document and returns the data as SMALLINT type.
Syntax
Scalar function |
---|
>>-extractSmallint----(--xmlobj--,--path--)-------------------->< |
Table function |
---|
>>-extractSmallints----(--xmlobj--,--path--)------------------->< |
Parameters
Table 30. extractSmallint and extractSmallints 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
SMALLINT
Returned column name (table function)
returnedSmallint
Example
In the following example, the value of Quantity in all sales orders is extracted as SMALLINT
SELECT * from table(db2xml.extractSmallints(Order, ('c:\dxx\samples\xml\getstart.xml'), '/Order/Part/Quantity')) as x;