Extract Function Returns ORA-19025 after DELETEXML Command (Doc ID 1440390.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Server - Standard Edition - Version: 11.2.0.2 and later   [Release: 11.2 and later ]
This problem can occur on any platform.

Symptoms


Following error is generated:

ERROR:
ORA-19025: EXTRACTVALUE returns value of only one node

When try to select the content of a row after performed a deleteXML command on a node from within the XML content. For example, create table of OF XMLType and insert following data into it:
<product_details id="1"><product
id="21"><name>test1</name><code>123</code></product><product
id="20"><name>test2</name><code>456</code></product></product_details>

then delete the product node with id = 21 from the XML content.

select with extract now produces the following error:
SELECT extract(OBJECT_VALUE, '/product_details[@id=1]') "Xml" FROM test WHERE
XMLEXISTS('/product_details[@id=1]' PASSING OBJECT_VALUE);

ERROR:
ORA-19025: EXTRACTVALUE returns value of only one node

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms