OracleException:“ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小
目录
Oracle.ManagedDataAccess.Client.OracleException:“ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小
SQL 全选
create or replace PROCEDURE USP_TEST1
(
PARAM1 IN VARCHAR,
PARAM2 IN VARCHAR,
PARAM3 IN DATE,
OUTVAR OUT VARCHAR
) AS
BEGIN
OUTVAR:=PARAM1 || '--' || PARAM2 || '--' || PARAM3;
END USP_TEST1;
解决方案
C# 全选
var p1 = db.CreateParameter("PARAM1", "code1");
var p2 = db.CreateParameter("PARAM2", "code2");
var p3 = db.CreateParameter("PARAM3", DateTime.Today);
var p4 = db.CreateParameter("OUTVAR", "", DbType.String, ParameterDirection.Output);
p4.Size = 10000; //指定参数缓冲区大小
var data = db.ExecuteSql("USP_TEST1", CommandType.StoredProcedure, p1, p2, p3, p4);
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网