ave*_*net 2 xml oracle updatexml
我可以写:
update my_table
set xml = updateXML(xml, '/a/b', '1')
where document_id = 123
Run Code Online (Sandbox Code Playgroud)
现在,如果在同一更新查询中我也想将/ a / c设置为2(另外将/ a / b设置为1)呢?我很想写:
update my_table
set
xml = updateXML(xml, '/a/b', '1'),
xml = updateXML(xml, '/a/c', '2')
where document_id = 123
Run Code Online (Sandbox Code Playgroud)
但这给了我一个“ ORA-00957:重复的列名”。关于如何做到这一点的任何建议?
该文档指出可以重复XPath字符串和表达式 http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions205.htm#i1134878
所以尝试
更新my_table设置xml = updateXML(xml,'/ a / b','1','/ a / c','2')其中document_id = 123