I am running the SELECT query from the Oracle SQL developer IDE on my RHEL box as below
SELECT count(*)
From xyz
WHERE xmltype(xyz.xmlColumn).existsNode('//name=""') = 1;
Above query works fine if I execute for single record. But when I execute it for the whole table it fails with the error:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of 'C'
Error at line 1
ORA-06512: at "SYS.XMLTYPE", line 272
ORA-06512: at line 1
31011. 00000 - "XML parsing failed"
*Cause: XML parser returned an error while trying to parse the document.
*Action: Check if the document to be parsed is valid.
Any pointers on above will help me.
codeSELECT * From xyz WHERE xmltype(xyz.xmlColumn).existsNode('//name=""') = 1;codeIt encounters error only when I want to get count(*)select *may appear to work better thanselect count(*), but only because it hasn't retrieved all the records yet. Try to find a single value that causes the error, you'll probably see something wrong with the XML. Finding that one value can be difficult, because it's difficult to know the exact order of SQL processing.