Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

oracle xml to column

$
0
0

i am using oracle 12g. and my table structure has two column, 1st is ID of the record, 2nd column is defined as XMLTYPE.

now the data stored in XMLTYPE is like a xml format. but i don't know how can i write a sql to retrieve the tag to column.

below is my example.

<row id='1'><c1>Name</c1><c4>Gender</c4><c4 m='2'>F</c4><c4 m='3'>M</c4><c6>Address</c6><c8>Nationality</c8></row>

every data stored in XMLTYPE is not fixed lenght. how can i write a sql to convert above xml format to column as below expected result.

 

Name   Gender        M   Address    Nationality


Viewing all articles
Browse latest Browse all 1350

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>