MIHIR KAR
asked on
How to replace XML string in DB!
ASKER
Hi Alex, Thanks for share this.
I have found following code for update XML type.
UPDATE warehouses SET warehouse_spec =
UPDATEXML(warehouse_spec,
'/Warehouse/Docks/text()', 4)
--/Warehouse/Docks/text()' I don't understand the 2nd parameter how it use if i want to replace a string with new string/null how can i use it.
WHERE warehouse_name = 'San Francisco';
Thanks!
I have found following code for update XML type.
UPDATE warehouses SET warehouse_spec =
UPDATEXML(warehouse_spec,
'/Warehouse/Docks/text()',
--/Warehouse/Docks/text()'
WHERE warehouse_name = 'San Francisco';
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions205.htm
https://odieweblog.wordpress.com/2012/06/19/how-to-update-xml-nodes-with-values-from-same-doc/
http://www.java2s.com/Code/Oracle/XML/UsetheUPDATEXMLfunctiontochangeelementvalue.htm
With the proper XPath expression, you should be able to update the XML column easily ;-)