I have a table 'Users' with column 'Values' in a Oracle database which has XML data like so:
<Attributes>
<Map>
<entry key="first" value="Linda"/>
<entry key="groups" value="Manager"/>
<entry key="last" value="Davis"/>
<entry key="locked" value="N"/>
<entry key="status" value="A"/>
</Map>
</Attributes>
I wish to extract them like:
Attributes_Values
=================
first = Linda
groups = Manager
last = Davis
I tried ExtractValue function but it returns error saying 'missing right parenthesis'. My query below:
SELECT EXTRACTVALUE(Values, '/Attributes/Map/entry[@key='first']@value') "Attribute_Values" from
Users;