Returns the value of the XML node in contrast to extract(), which returns the XML node.
Returns a value from evaluated XML column, document, or string. For details on XPATH, see http://www.w3.org/TR/xpath.
Specify an absolute XPath_string with an initial slash. Omit the initial slash to indicate a path relative to the root node. If no match is found, these functions return an empty string.
SELECT extractvalue(col2, '/personnel/person[3]/name/given') FROM tab;
The output is the given name: Jason
SELECT warehouse_name,
extractvalue(e.warehouse_spec, '/Warehouse/Docks')
"Docks"
FROM warehouses e
WHERE warehouse_spec IS NOT NULL;
WAREHOUSE_NAME Docks
-------------------- ------------
Liverpool, England 2
Taipei, Taiwan 1
Buenos Aires, Argentina
Seattle, USA 3