How to add attribute to xml contained in CLOB in Oracle database? I can use the UpdateXML function to update an existing attribute, but it will not add it.
You can use the combination deleteXml()with appendChildXml(), insertChildXml()or insertXmlBefore(), to delete an existing node, and then add it back again with the new attribute that is now included.
deleteXml()
appendChildXml()
insertChildXml()
insertXmlBefore()
with t as ( select xmltype('<a><b c="2">1</b></a>') x, '/a/b' node, --node where attribute located '@d' att, --attribute name 'new' val --new value from dual ) select x, insertchildxml(deletexml(x,node||'/'||att), node, att, val) x_new from t
Oracle SQL "attrname = attrval" mynode xml clobcol mytable
update mytable s set s.clobcol = insertchildxml(xmltype(s.clobcol) ,'//mynode' ,'@attrname' ,'attrval' ).getclobval();
Source: https://habr.com/ru/post/1733566/More articles:Create a list from an SQL database using HTML / PHP - htmlIntegration of First Data payment gateways (formerly YourPay and LinkPoint) with ASP user reservation system - asp-classicEmail Template Engine - c #Application deployment / redeployment traps for Tomcat without restarting - javaSSL lock for Android while reading when connection changes - javaHide marker sizes in designer using C #? - c #Rails: How to add an additional parameter for link_to link to a resource? - resthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1733569/android-how-to-set-wifi-settings-to-access-internet-connection-in-android-simulator&usg=ALkJrhjFs9gPUEfaAJ82Ur1zJU0Y8LLTFAAlgorithms: data binarization - algorithmUsing version control commands (VCS) on a local file system without a VCS client - gitAll Articles