When I load an xml file using bfilename, the values for some attributes do not match the xml file as I expected.
Here is the minimal code that demonstrates the problem:
create table xxln.t_xml_5a
(
xdata XMLTYPE
)
-- load xml from file
insert into xxln.t_xml_5a
SELECT XMLTYPE (bfilename ('XXLN_PIM2LMD_DIR', 'delta.xml'), NLS_CHARSET_ID ('AL32UTF8')) FROM DUAL
commit
select xdata from xxln.t_xml_5a
-- file contents, .... indicates attr omitted for brevity
<PCS PCSI="379424" ACTION="DEL" NAME="Energy Design Update" .....
LICENSOR_NUM="105836" LICENSOR_NAME="Wolters Kluwer US Corporation"
LEGACY_HCSI="379424"/>
-- actually loaded. Note LEGACY_HCSI field does not match input
<PCS PCSI="379424" ACTION="DEL" NAME="Energy Design Update" .....
LICENSOR_NUM="105836" LICENSOR_NAME="Wolters Kluwer US Corporation"
LEGACY_HCSI="BNA (ET Version for E&Y, D&T & KPMG)"/>
-- the value for LEGACY_HCSI above is actually the LICENSOR_NAME from the previous record,
-- although this pattern is not always repeatable (the data actually loaded appears random in many cases)
LICENSOR_NAME="BNA (ET Version for E&Y, D&T & KPMG)"
There are many more attributes in the xml file than shown, however I have reduced them down to the minimum that
demonstrates the problem for posting purposes. The xml is in attribute normal form.
One things I notice is that the data corruption is strongly (but not completely) correlated to attributes
missing. In other words, for many of the corrupted attributes, another optional attribute is missing from the
xml element. For testing purposes, I manually put in this missing attribute and the LEGACY_HCSI field was
no longer corrupted but other populated attributes in the file were loaded as blank. I don't have control of the data
feed xml, so I can't assume all the optional attributes are there for production.
I must be missing something here or perhaps exceeding some limit perhaps for attribute text size. Why would the xml loaded not match what is in the file?
Thanks for your help isolating this issue.
Here is my version info:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
I've seen the same issue in TOAD and sqldeveloper.