I have a record with an xml data type field. The value starts out raw, basically just a "<mynode />". I also have some procedures that handle related records (in the thousands) and it checks whether to perform taskA or taskB and add an attribute to the xml.
Does the xml dml have some way of checking if an attribute exists that I could use with the update table command?
example:
[tt]
update myXmlTable
set theXmlField.modify('insert attribute taskA {"abc"} into (/mynode)[1]')
where theId = 1
[/tt]
the above will work fine the first time but will obviously give an error when run a 2nd time. I also want to avoid checking if the attribute exists with the exist() method as this will absolutely kill the performance.
I'm hoping there would be a way to check along the lines of:
if attributeexists(taskA) then update it with "abc" else insert it with value of "abc"
Thanks in advance
-----------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook
Does the xml dml have some way of checking if an attribute exists that I could use with the update table command?
example:
[tt]
update myXmlTable
set theXmlField.modify('insert attribute taskA {"abc"} into (/mynode)[1]')
where theId = 1
[/tt]
the above will work fine the first time but will obviously give an error when run a 2nd time. I also want to avoid checking if the attribute exists with the exist() method as this will absolutely kill the performance.
I'm hoping there would be a way to check along the lines of:
if attributeexists(taskA) then update it with "abc" else insert it with value of "abc"
Thanks in advance
-----------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook