将XML从CLOB列转换为XMLType列时出错

时间:2021-03-07 09:12:59

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

我正在尝试将来自CLOB的一些XML数据转换为XMLType列。

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

XML有一些突出的字符作为值(文档用法语写)。

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.

p_id和p_xmldata是先前从原始表中提取的变量。

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.

我认为法语字符阻止XMLType正常工作。或者可能是格式错误的XML标签?问题是,该表包含3k + XML文档,只有2个在XMLType列中转换。


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 个解决方案

#1


7  

I used createxml method and now it works fine

我使用了createxml方法,现在它工作正常

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

#1


7  

I used createxml method and now it works fine

我使用了createxml方法,现在它工作正常

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