在xml中遇到节点是空的,这个样子<name/>
然后我在网上找了很久总算找到解决方案了,顺便吐槽一下,网上的sql语句居然都是错的
一般的更新语句,适用于<name></name>
update table1 t set t.xml=updatexml(t.xml,'/data/dataTwo/name/text()',
'value'
)
where 1=1;
<name/>这种情况的语句为
update table1 t set t.xml=updatexml(t.xml,'/data/dataTwo/name',
'<name>' || 'value' || '</name>'
)
where 1=1;
本文介绍了解决XML中空节点更新的问题,并提供了针对不同形式的XML节点的SQL更新语句示例。
1830

被折叠的 条评论
为什么被折叠?



