3

I'm trying to convert some XML data coming from a CLOB to a XMLType column.

The XML have some accentuated characters as values (documents are written in french).

Here is what the instruction looks like :

insert into mytable (id, xmldata) values (p_id, xmltype(p_xmldata));

p_id and p_xmldata are variables previously extracted from the original table.

I think the french characters prevents XMLType to work correctly. Or maybe malformed XML tags? The problem is, the table holds 3k+ XML documents and only 2 are converted in the XMLType column.


Update: These are the errors I get when I try a simple:

select xmltype(xmldata) from mytable

ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.XMLTYPE", line 254
ORA-06512: at line 1

1 Answer 1

7

I used createxml method and now it works fine

insert into mytable (id, xmldata) values (p_id, xmltype.createxml(p_xmldata));
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot man. This minor change proved hugely beneficial for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.