sqloracle-databaseupdatexml

How do I add an attribute to xml contained within a CLOB in an Oracle database?


How do I add an attribute to xml contained within a CLOB in an Oracle database? I can use the UpdateXML function to update an existing attribute but it will not add one.


Solution

  • You could use a combination of deleteXml() along with either appendChildXml(), insertChildXml(), or insertXmlBefore() to remove the existing node and then re-add it back with the new attribute now included.