1

I'm trying to extract the first occurrence in an xml message like this;

NVL(EXTRACTVALUE(message,'//ElementValue[1]'),NULL) as ElementValue

I get error:

XML - ORA-19025: EXTRACTVALUE returns value of only one node.

Any suggestions?

Code Different
  • 82,550
  • 14
  • 135
  • 153

1 Answers1

1

Currently, the XPath would return every first ElementValue in a parent element. To actually return only the first occurrence of ElementValue in the entire document, you need to use parentheses before position index :

(//ElementValue)[1]

Also read @Dimitre Novatchev's answer here

Community
  • 1
  • 1
har07
  • 86,209
  • 12
  • 77
  • 125