Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/379.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml Oracle:如何将文本节点添加到现有元素中_Xml_Oracle_Updatexml - Fatal编程技术网

Xml Oracle:如何将文本节点添加到现有元素中

Xml Oracle:如何将文本节点添加到现有元素中,xml,oracle,updatexml,Xml,Oracle,Updatexml,在Oracle中,您可以编写: update t set xml = updateXML(xml, '/a/b/text()', 'gaga') 只有当元素中已经有一些文本时,这才有效。如果数据库中的文档看起来像: <a> <b/> </a> 这里有一种方法: update t set xml = updateXML(xml, '/a/b', XMLType('<b>gaga</b>')) 更新t set xml=upda

在Oracle中,您可以编写:

update t
set xml = updateXML(xml, '/a/b/text()', 'gaga')
只有当
元素中已经有一些文本时,这才有效。如果数据库中的文档看起来像:

<a>
    <b/>
</a>

这里有一种方法:

update t
set xml = updateXML(xml, '/a/b', XMLType('<b>gaga</b>'))
更新t
set xml=updateXML(xml,/a/b,'XMLType('gaga'))

我不觉得这很优雅,但我不确定你能做得更好。

这里有一种方法:

update t
set xml = updateXML(xml, '/a/b', XMLType('<b>gaga</b>'))
更新t
set xml=updateXML(xml,/a/b,'XMLType('gaga'))
我不觉得这很优雅,但我不确定你能做得更好