updatexml

Oracle: how to use updateXML to update multiple nodes in a document?

I can write: update my_table set xml = updateXML(xml, '/a/b', '1') where document_id = 123 Now what if in the same update query I also want to set /a/c to 2 (in addition /a/b to 1)? I am tempted to write: update my_table set xml = updateXML(xml, '/a/b', '1'), xml = updateXML(xml, '/a/c', '2') where document_id = 123 But th...

Oracle: how to add a text node into an existing element

In Oracle, you can write: update t set xml = updateXML(xml, '/a/b/text()', 'gaga') This works only if you already have some text in the <b> element. How to update the document and "add some text" in <b> if the document in the database looks like: <a> <b/> </a> ...

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. ...

MySQL UpdateXML with automatic node inserting?

I am writing an application that supports custom fields. Currently I store all custom fields in a XML formated text field ( e.g. '<root><field1>val1</field1><field2>val2</field2></root>' in cust_field) I am able to to use updateXML(cust_field, '/root/field1', '<field1>new value</field1') to update those values, however if I use updateXM...