Home » Developer & Programmer » JDeveloper, Java & XML » ORA-19025: EXTRACTVALUE returns value of only one node (10g)
ORA-19025: EXTRACTVALUE returns value of only one node [message #364790] Wed, 10 December 2008 01:14 Go to next message
huda10
Messages: 23
Registered: December 2008
Junior Member
Hi,
The following error message
"ORA-19025: EXTRACTVALUE returns value of only one node
Given XPath points to more than one node.
Action: Rewrite the query so that exactly one node is returned."
is displayed when trying to query. I'm using the following query to extract xml data from the table.

select EXTRACTVALUE(xml_file,
'emp/row/ename'
) ENAME
from test_clob1.

table creation--
CREATE TABLE test_clob1 (
id NUMBER(15)
, file_name VARCHAR2(1000)
, xml_file xmltype
, timestamp DATE
);

xmldata file--
<emp>
<row>
<empno>3</empno>
<ename>ra</ename>
</row>
<row>
<empno>9</empno>
<ename>a</ename>
</row>
<row>
<empno>6</empno>
<ename>r</ename>
</row>
</emp>.
Can you please help on this.

Re: ORA-19025: EXTRACTVALUE returns value of only one node [message #364792 is a reply to message #364790] Wed, 10 December 2008 01:20 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
What do you want to get? One specific ename or all enames?

Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and use code tags.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel
Re: ORA-19025: EXTRACTVALUE returns value of only one node [message #364795 is a reply to message #364792] Wed, 10 December 2008 01:25 Go to previous messageGo to next message
huda10
Messages: 23
Registered: December 2008
Junior Member
Want to get all the names.
Re: ORA-19025: EXTRACTVALUE returns value of only one node [message #364798 is a reply to message #364795] Wed, 10 December 2008 01:33 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
SQL> with data as (
  2    select xmltype('<emp>
  3  <row>
  4  <empno>3</empno>
  5  <ename>ra</ename>
  6  </row>
  7  <row>
  8  <empno>9</empno>
  9  <ename>a</ename>
 10  </row>
 11  <row>
 12  <empno>6</empno>
 13  <ename>r</ename>
 14  </row>
 15  </emp>') xml_data
 16    from dual )
 17  select extractvalue(value(x),'/row/ename') ename
 18  from data, table(xmlsequence(extract(xml_data,'/emp/row'))) x
 19  /
ENAME
----------------------------------------------------------------
ra
a
r

3 rows selected.

Regards
Michel
Re: ORA-19025: EXTRACTVALUE returns value of only one node [message #364800 is a reply to message #364798] Wed, 10 December 2008 01:41 Go to previous message
huda10
Messages: 23
Registered: December 2008
Junior Member
Thanks a lot Michel.It works now..

Thanks & Regards,
Abdul Huda
Previous Topic: How Java threads are mapped to PL/SQL execution threads??
Next Topic: EJB 3.0 Compatible
Goto Forum:
  


Current Time: Tue Dec 17 23:08:48 CST 2024