How can I append an attribute to an xml data value?
I want to add an attribute that doesn't exist, something like
select appendxml(metadata, '/document/@newid', 2) from mytable where id = 1; <=== NO SUCH FUNCTION.
If the attribute already exists, you can call
select updatexml(metadata, '/document/@oldid', 1) from mytable where id = 1;
I don't want to have to do string manipulation to "splice in" the new attribute, then typecast it back to an xmltype. That's a lot of work, is error prone and has performance implications.
Thanks in advance.