I have xml document
<d>
<r>a<b</r>
</d>
and I want to update it to
<d>
<r>a<b or c>d</r>
</d>
using updateXML statement.
Executing
select updateXML(xmltype('<d><r>a<b</r></d>'),
'/d/r[1]/text()',
'a<b or c>d')
from dual;
returns
<d>
<r>a&lt;b or c&gt;d</r>
</d>
It is not good because of "&".
Executing
select updateXML(xmltype('<d><r>a<b</r></d>'),
'/d/r[1]/text()',
'a<b or c>d')
from dual;
throws
ORA-31067 XML nodes must be updated with valid nodes and of the same type.
How can I reach expected result?
EDIT: ORA-31067 is raised only in 10g database. It is correct query in 11g.
EDIT2: Error raised on 10.2.0.3 version and does not raised on 10.2.0.5. May by it was a bug?