你这样做:
(即表yourdata
包含一个clob列c
)
SQL> select extractvalue(xmltype(c), '/wbi:event/wbi:appData/wbi:content/@wbi:name','xmlns:wbi="http://foo"') name,
2 extractvalue(xmltype(c), '/wbi:event/wbi:appData/wbi:content/wbi:value','xmlns:wbi="http://foo"') status
3 from yourdata
4 /
NAME STATUS
--------------- ---------------
1st_status Success
这假设你 wbi 命名空间是 xmlns:wbi="http://foo"
如果 //content 是一个重复的标签,那么你可以这样做:
SQL> select extractvalue(value(t), '/wbi:content/@wbi:name','xmlns:wbi="http://foo"') name,
2 extractvalue(value(t), '/wbi:content/wbi:value','xmlns:wbi="http://foo"') status
3 from yourdata,
4 table(xmlsequence(extract(xmltype(c), '/wbi:event/wbi:appData/wbi:content', 'xmlns:wbi="http://foo"'))) t
5
SQL> /
NAME STATUS
--------------- ---------------
1st_status Success
2nd_status Failure