Home » Developer & Programmer » JDeveloper, Java & XML » XMLTYPE usage in a query (Oracle 11g)
XMLTYPE usage in a query [message #670054] Thu, 31 May 2018 08:45 Go to previous message
srinivas.k2005
Messages: 395
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


 
Read Message
Read Message
Read Message
Previous Topic: installing Jdeveloper
Next Topic: Oracle Retail v16 seeded customization - anyone pulled it off?
Goto Forum:
  


Current Time: Mon Jan 27 09:41:54 CST 2020