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
  • 90,614
  • 16
  • 144
  • 163

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
  • 88,338
  • 12
  • 84
  • 137