XMLTYPE usage in a query [message #670054] |
Thu, 31 May 2018 08:45 |
srinivas.k2005
Messages: 404 Registered: August 2006
|
Senior Member |
|
|
Hi, i am trying to get the output with column and value as separate columns, can you help on below
with data as (
select XMLTYPE(
'<?xml version=''1.0'' encoding=''UTF-8''?>
<map>
<entry><string>test1</string><string>123</string></entry>
<entry><string>test2</string><string>GB</string></entry>
</map>') val from dual)
select "col"
from data,
xmltable('//entry' passing val
columns
"col" varchar2(100) path '/entry'
);
Output i need as two columns as below
col value
test1 123
test2 GB
|
|
|
|
|