Oracle.Dataaccess错误ORA-06502:PL / SQL:数字或值错误:字符串缓冲区太小 [英] Oracle.Dataaccess error ORA-06502: PL/SQL: numeric or value error: character string buffer too small
问题描述
我从调用.NET应用程序中的存储过程。我们把proc返回VARCHAR2类型的输出参数。为了FET CH这out参数我传递的参数的命令的OracleParameter:
parm12 =新的OracleParameter(密押
,OracleDbType.Varchar2
,OUT2
,ParameterDirection.Output);
当我执行PROC我收到一个错误
PL / SQL:数字或值错误:字符串缓冲区太小。
找到了答案。
有关OUT参数我声明的大小最大为varchar - 32767,并开始工作。
。要简化,该存储过程返回类型为VARCHAR2的参数OUT。但要使用来自.NET我经过VARCHAR2无任何大小的输出。所以分配到接受她的reurn值的缓冲空间为0字节。当PROC返回值比分配的缓冲区是0字节是错误的更多信息。
所以,我指定VARCHAR2-32767在C#code中的最大值,并开始工作。)
I am invoking a stored proc from .NET app. The proc returns an out parameter of type Varchar2. To fet ch the out parameter I am passing the parameter to the command as OracleParameter:
parm12 = new OracleParameter("testkey"
, OracleDbType.Varchar2
, out2
, ParameterDirection.Output);
When I execute the proc I am receiving an error
PL/SQL: numeric or value error: character string buffer too small.
Found the answer.
For the OUT parameter i declared the size to max of varchar - 32767 and it started to work.
To simplify, the stored proc returns a parameter OUT of type VARCHAR2. But to consume that output from .NET i was passing VARCHAR2 without any size. So the buffer space allocated to recieve the reurn value was 0 bytes. When the proc returns the value more than allocated buffer which is 0 bytes it errors out.
So i specified the max of VARCHAR2-32767 in the C# code and it started to work :).
这篇关于Oracle.Dataaccess错误ORA-06502:PL / SQL:数字或值错误:字符串缓冲区太小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!