如何在Oracle表中插入/更新更大尺寸的数据? [英] How to insert/update larger size of data in the Oracle tables?

查看:73
本文介绍了如何在Oracle表中插入/更新更大尺寸的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想插入字符长度大于10,000的大尺寸数据.我对每一列都使用了CLOB数据类型.我无法插入/更新显示以下错误的大数据:

I want to insert large size of data that character length is more than 10,000. I used CLOB data type to each column. I can't insert/update that large data it shows following error:

ORA-01704: string literal too long

我的代码

 insert into table1 value(1,'values>10000'); 

推荐答案

您必须将值分配给变量&使用变量插入数据

You'll have to assign the value to a variable & use the variable to insert the data

DECLARE
    v_long_text CLOB;
BEGIN
    v_long_text := 'your long string of text';

    INSERT INTO table
    VALUES      (1,
                 v_long_text);
END; 


为了清楚起见:字符串设置了限制:


To make it clear: there are limits set to character strings:

您不能在

  • SQL中的4000个字节
  • 在PLSQL中为32k

如果要超出此范围,则必须使用绑定变量.

If you want to go above this, you'll have to use bind variables.

这篇关于如何在Oracle表中插入/更新更大尺寸的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆