Skip to Main Content

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, Navendra.

Asked: July 16, 2016 - 3:28 pm UTC

Last updated: July 17, 2016 - 12:45 am UTC

Version: 11g

Viewed 1000+ times

You Asked

Hi Tom,
I need to update some attribute(XML) in oracle table whose datatype is XML. Is there any package provided by oracle which help me? Or if you can tell me anyway how can I update it.

and Connor said...

Plenty of good examples out there on the web. Here are some

https://odieweblog.wordpress.com/2012/06/19/how-to-update-xml-nodes-with-values-from-same-doc/

But note, that we are moving towards a single means of updating XML, and that is via Xquery (and the other functions, eg updatexml will slowly disappear over time), so you should perhaps move in that direction.

Some examples here

http://www.liberidu.com/blog/2012/10/02/oow-2012-xquery-update-hol/

http://www.liberidu.com/blog/2013/06/28/oracle-12c-xquery-update/

and the official documentation here

https://docs.oracle.com/database/121/ADXDB/xdb04cre.htm

Hope this helps.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library