Can you please let me know an sql that will update a xml column
I am using db2 9.7 on Linux
The table contains a single XML column.
The tag I want to replace or create is <sendingProcessName>.
If it exists I want to replace its value
If it doesnt exist I want to create it
Is there a single xpath query that does this?
This topic has been locked.
3 replies Latest Post - 2011-12-12T18:13:46Z by MatthiasNicola
Pinned topic update a xml column
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2011-12-12T18:13:46Z at 2011-12-12T18:13:46Z by MatthiasNicola
Re: update a xml column2011-12-12T17:36:01Z in response to VV4H_mario_fernandesI have been able to get the answer for this myself.
I first have to do a delete and then insert.
Please see this thread for delete details
Please see here for insert
MatthiasNicola 120000E28R321 PostsACCEPTED ANSWER
Re: update a xml column2011-12-12T18:13:46Z in response to VV4H_mario_fernandesI would also recommend this article:
Updating XML in DB2
Note that you can not only delete and insert elements. You can also replace elements, replace their values, and rename them. And the same for attributes.