0

I'm running Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production.

When using

updatexml()

I get the error ORA-31067: XML nodes must be updated with valid nodes and of the same type. The XPath_string denoting each node to be updated is always referencing a text() node, so AFAIK there is no type restriction when updating those nodes. And the content written into those nodes is always either of type Varchar2, Char or Number.

Even worse this error happens in production but I simply can't replicate it on my test system.

I wonder if it might have something to do with the fact that one of the nodes in my XML has an xsi:type attribute with a custom type. Where can I find the type definition? Maybe this is defined somewhere in the production system but not on my test clone?

I notice that sometimes the text might contain <characters and this seems to be a bug in older versions(10g) of Oracle, cf. Oracle updateXml "less than sign" as text But again this is not happening on my test system and I tried all kinds of combinations of <, >, &.

Community
  • 1
  • 1
Roland
  • 7,525
  • 13
  • 61
  • 124
  • It does sound like the value being passed in the update is being seen as XML, or something other than plain text. You'll need to show your code and sample data that causes it in production - though presumably you don't have that or you'd be able to reproduce it? Are your test and production DBs the same version and patch level? – Alex Poole Jan 26 '15 at 10:21
  • @AlexPoole Yes same version, don't know about the patch version though. What would cause a value to be seen as something different? I mean if the type is VARCHAR2, Char, Number converting to text should be straightforward, no? – Roland Jan 26 '15 at 10:28
  • Depends what the value is maybe; different patch levels *might* mean you're hitting a bug that's been fixed on one DB but not the other, but pure speculation. Can you get the error with a standalone SQL statement in production, like those in the question you linked to? – Alex Poole Jan 26 '15 at 10:32

0 Answers0