xml - 使用包含命名空间的 SQL-SERVER-2016 从 XML 中检索数据
问题描述
在此之前,在 AppHdr 和 Document 中收到没有命名空间的 XML,我能够从中检索数据。
我在新引入 XML 之前的查询:
SELECT XMLData.Value('(/Root/AppHdr/BizMsgIdr)[1]', 'CHAR(16)') As MessageID,
XMLData.Value('(/Root/Document/CorpActnGnlInf/OffclCorpActnEvtId)[1]', 'CHAR(16)') As EventID
FROM Announcement
新收到的 XML 如下:
<Root>
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<BizMsgIdr>MY190531X0000007</BizMsgIdr>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:seev.031.001.08" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CorpActnGnlInf>
<OffclCorpActnEvtId>MY190531BONU0007</OffclCorpActnEvtId>
</CorpActnGnlInf>
</Document>
</Root>
请协助介绍新的 XML 查询如何引入。
解决方案
推荐阅读
- gradle - 无法使用方法 toBuilder()(未定义)
- c# - ASP.NET Core API oData 和 API 层模型
- java - JPA @JoinColumn 自定义对象类型
- java - 如何根据 android studio 中的 listview 项目点击更改活动图像和文本?java 或 kotlin
- c++ - 类模板'没有匹配的函数调用 Player::Player()'
- c# - 如何使用 aruco 在检测到的标记上绘制对象(如窗格或立方体)?
- python - 如何在 groupby 上应用自己的构建功能
- c# - 实体框架核心在更新时生成不正确的 SQL
- javascript - 视差:如何避免空格?
- webots - 如何编辑内置机器人的节点