有张表含有xmltype 字段,字段的类容如下,现要读取string 中的类容。

<ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <string>bbd174bb-028b-49e4-8f81-0e8bfd85232a</string>
  <string>87f7dfa0-1a37-47c6-a203-0f9fc0d51912</string>
  <string>b3f7a411-1170-4d07-918d-b53151c35f6b</string>
</ArrayOfString>

xmltype 字段中含有相同标签时,用extractValue 函数处理会报错。

oralce--xmltpye 类型处理

使用下面的sql 可以获取单个标签的类容:

 select OBJECTID, extractValue(STARTNOTIFYPERSON,'/ArrayOfString/string[1]') from 
  i_czlc where OBJECTID='223b7c28-6222-4227-b381-3c1256561b11'

oralce--xmltpye 类型处理

 

使用下面的sql 可以获取所有类容:

select x.OBJECTID, extractValue(value(i),'/string') a from  i_czlc x,
 table(XMLSequence(extract(x.STARTNOTIFYPERSON,'/ArrayOfString/string'))) i ;

 oralce--xmltpye 类型处理

 

 

 

 

相关文章:

  • 2021-10-29
  • 2022-02-15
  • 2021-07-01
  • 2022-12-23
  • 2021-07-06
  • 2021-06-03
  • 2021-06-10
猜你喜欢
  • 2021-09-04
  • 2022-01-22
  • 2021-11-10
  • 2022-12-23
  • 2021-06-04
  • 2022-12-23
相关资源
相似解决方案