I have columns as VALUE in DUMMY table with type XMLTYPE. It contains:
<?xml version="1.0"?>
<ROWSET>
<Value>
<Data>802
</Data>
</Value>
<Value>
<Data>902
</Data>
</Value>
</ROWSET>
I need to replace it with NULL for 802 value tag. The output should be :
<?xml version="1.0"?>
<ROWSET>
<Value>
<Data>902
</Data>
</Value>
</ROWSET>
802 value tag should be removed with NULL.
I tried UpdateXML():
update Dummy set VALUE=updatexml(VALUE,'ROWSET/Value/Data/text()','');
But it will update only 802 value with null.
2nd Approach: update Dummy set Value=updatexml(Value,'ROWSET','');
But it will delete everything inside ROWSET tag.Then,It will contain only :
<?xml version="1.0"?>
<ROWSET/>
I tried Replace() too.
update Dummy set emps=replace('
<Value><Data>802
</Data></Value>',null);
Then it will remove other values from VALUE column and remain only the mentioned tag in replace().
After this replace(), It contains :
<Value><Data>802
</Data></Value>
Please suggest me on this.