Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL EXTRACTVALUE Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

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      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 60 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?