We are having an 11.2.0.3 database and I am trying to execute the procedure and it is throwing a error ORA-06502: PL/SQL: numeric or value error: character string buffer too small
when it comes to line
我们有一个11.2.0.3数据库,我正在尝试执行该程序,它正在抛出错误ORA-06502:PL / SQL:数字或值错误:字符串缓冲区太小,当涉及到行
Execute immediate var1||var2||var3||var4;
Here all the variables are declared as long datatype and size varies as below.
这里所有变量都声明为long数据类型,大小如下所示。
Size: 200,300,30200,20100 bytes
大小:200,300,30200,20100字节
What could be the issue. what could be the reason for this error. I see a lot of generic errors.So getting confused.
可能是什么问题。这可能是造成这种错误的原因。我看到很多一般性错误。所以感到困惑。
Thanks SHIYAS M
谢谢SHIYAS M.
1 个解决方案
#1
0
Maybe Oracle tries to concatenate VARCHAR data types, because var1
has got only 200 bytes and thus considered as VARCHAR instead of CLOB.
也许Oracle尝试连接VARCHAR数据类型,因为var1只有200个字节,因此被认为是VARCHAR而不是CLOB。
Maybe this one works:
也许这个有效:
Execute immediate TO_CLOB(var1)||TO_CLOB(var2)||TO_CLOB(var3)||TO_CLOB(var4);
Another problem could be your string itself. Can you output the string and execute manually?
另一个问题可能是你的字符串本身。你能输出字符串并手动执行吗?
#1
0
Maybe Oracle tries to concatenate VARCHAR data types, because var1
has got only 200 bytes and thus considered as VARCHAR instead of CLOB.
也许Oracle尝试连接VARCHAR数据类型,因为var1只有200个字节,因此被认为是VARCHAR而不是CLOB。
Maybe this one works:
也许这个有效:
Execute immediate TO_CLOB(var1)||TO_CLOB(var2)||TO_CLOB(var3)||TO_CLOB(var4);
Another problem could be your string itself. Can you output the string and execute manually?
另一个问题可能是你的字符串本身。你能输出字符串并手动执行吗?