Extract values from XML String in oracle

2k views Asked by At

How do you extract the value of an xml string in oracle e.g.

XML Example

<?xml version="1.0" encoding="UTF-8"?>


 <node>
      <key label="name">Test</key>
      <key label="lastname">Test</key>
   </node>

So far this is what I have tried to extract the values

SELECT <COLUMN>,  EXTRACTVALUE(xmltype(<COLUMN>),'/node/lastname')  AS TEST FROM <TABLE>;

But it always returns a null value.

0

There are 0 answers