Quick Search:
 
 The Oracle PL/SQL EXTRACTVALUE Function      [Return To Index] Jump to:  

Term: EXTRACTVALUE

Definition:
The Oracle EXTRACTVALUE function is an XML Type function which is used to select leaf node data value. Note that only lower or sublevel node values can be extracted. It returns value in VARCHAR2 format.

Example Usage:

The SQL query below returns the value existing on XPath '/Orders/MailAddressTo/Company'.

SELECT EXTRACTVALUE(OBJECT_VALUE, '/Orders/MailAddressTo/Company')
AS Company
FROM ORDERS_XML;

COMPANY
--------------
Google


The SQL query below returns the value existing on XPath /Orders/MailAddressTo. But note that the query fails because the XPath contains subcode.

SELECT EXTRACT_VALUE(OBJECT_VALUE, '/Invoice/MailAddressTo') AS MailAddressTo
FROM ORDERS_XML;

from orders_xml
*
ERROR at line 2:
ORA-19025: EXTRACTVALUE returns value of only one node


Related Links:
 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org