Insert XML with more than 4000 characters into a Oracle XMLTYPE column(将超过 4000 个字符的 XML 插入 Oracle XMLTYPE 列)
问题描述
我有一个 oracle 表,其中有一列来自SYS.XMLTYPE"类型的列和一个正在执行插入操作的存储过程:
I have an oracle table with a column from type "SYS.XMLTYPE" and a storage procudure which is doing the insert:
(短版):
PROCEDURE InsertXML
(
pXMLData IN LONG
)
IS
BEGIN
INSERT INTO MY_TABLE (XML_DATA) VALUES(pXMLData);
END InsertXML;
我从我的 C# 代码中调用这个 sp,类型为OracleType.LongVarChar".
I call this sp from my C# code with type "OracleType.LongVarChar".
现在的问题:如果 xml 的字符少于 4000 个,一切正常,但使用超过 4000 个字符的 xml 会出现以下错误:
Now the problem: If the xml has less than 4000 characters everything is working fine, but by using a xml with more than 4000 characters I get the following error:
ORA-20000: ORA-01461: can bind a LONG value only for insert into a LONG column
我该如何处理?谢谢 4 个答案
How can I handle this? Thx 4 answers
推荐答案
查看Oracle docs about XMLType
Check the Oracle docs about XMLType
另外,我认为数据类型应该是 CLOB(字符大对象).
Also, I believe the datatype should be a CLOB (Character Large Object).
这篇关于将超过 4000 个字符的 XML 插入 Oracle XMLTYPE 列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将超过 4000 个字符的 XML 插入 Oracle XMLTYPE 列
基础教程推荐
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 在多列上分布任意行 2021-01-01
