I have below table structure
ID int
xmlData xml
I want data in the xml column (xmlData) to updated with new value based on below condition. Below is the sample data in xml column.
<customer>
<name display="CName">abc</name>
<customerId display="CID">123</customerId>
</customer>
some rows in my table may not have customerId xml tag , i want to identity those and need to update the xml tag with customerId
Please suggest , how i can do this.
Thanks,
Use modify() Method (xml Data Type) with insert (XML DML).
Use exist() Method (xml Data Type) in the where clause so you only update the rows that does not have a
customerIdnode.