Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem in loading XML file to Database - character set error

466954Mar 27 2007 — edited Mar 28 2007
Dear Experts,
I am attempting to load an XML file (using the procedure getCLOBDocument) into an XMLType table. As below:

CREATE TABLE XMLTABLE OF XMLType;

INSERT INTO XMLTABLE
VALUES(XMLTYPE(getCLOBDocument('ServiceRequest.xml')));

When I do so, I get the following error:

ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00200: could not convert from encoding UTF-8 to UCS2
Error at line 1
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at line 1

I have seen this error on other listings, but it is not clear to me exactly how to resolve it. What character set do I need to have set on:

1) The XML data file header?
2) My local Windows machine (NLS_CHARACTERSET) ?
3) The Database on the server (In table: SYS.PROPS$ or nls_database_parameters?

Do they all have to be matching and what character set do I need to use and is that all that is required to solve this problem? I am using Oracle 9i R2 and the code is in PL/SQL.

Many thanks for your time,
Mark
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 25 2007
Added on Mar 27 2007
5 comments
1,085 views