Not NULL XMLTYPE column has zero length - how is this constructed?
We are in the process of migrating a database across platforms and have come up against an error during import for certain rows of a table containing an XMLTYPE column. If I select the column, for some rows, I get this:
select XML
from DOSSIER
WHERE id = 67989;
ERROR:
OCI-31011: XML parsing failed
If I look at the length of the column contents in the following fashion:
select dbms_lob.getlength(xmltype.getclobval(xml)) as xmllen
from DOSSIER
WHERE id = 67989;
XMLLEN
----------
0
Oracle reports that the length of the value is 0. However, it isn't NULL:
update DOSSIER
SET XML = NULL
WHERE id = 67989;
select XML
from DOSSIER
WHERE id = 67989;
ERROR:
OCI-31011: XML parsing failed
If I look at the length of the column contents in the following fashion:
select dbms_lob.getlength(xmltype.getclobval(xml)) as xmllen
from DOSSIER
WHERE id = 67989;
XMLLEN
----------
0
Oracle reports that the length of the value is 0. However, it isn't NULL:
update DOSSIER
SET XML = NULL
WHERE id = 67989;
0