我的代码:
Set ls_xml='<root><name>Johnbrick</name></root>
Replace the name to 'Michale dukes' in db2 XML.
Can anyone give solution for this.
以XML扩展结果:
Set ls_xml='<root><name>micheal Dukes</name></root>
我的代码:
Set ls_xml='<root><name>Johnbrick</name></root>
Replace the name to 'Michale dukes' in db2 XML.
Can anyone give solution for this.
以XML扩展结果:
Set ls_xml='<root><name>micheal Dukes</name></root>
SELECT
XMLQUERY( 'transform
copy $v2 := $v1
modify
do replace value of $v2/root/name with
"Michale dukes"
return $v2'
passing doc as "v1")
FROM (
select xmlparse(document '<root><name>Johnbrick</name></root>') doc
from sysibm.sysdummy1
) x;
已通过Db2 v11.5进行检查。
Db2 for i(AS / 400,iSeries)也对此问题进行了标记,目前不提供使用XPath转换XML文档的功能,仅提供查找/搜索选项。