存储过程如下:
CREATE OR REPLACE PROCEDURE HOSPITAL.S_TEST_TIME(IN_NUMBER IN NUMBER,
OUT_NUM OUT VARCHAR2) AS
V_NUM VARCHAR2(20);
BEGIN
INSERT INTO TEST_TIME (ID, INPUT_DATE) VALUES (IN_NUMBER, SYSDATE);
V_NUM := IN_NUMBER + 1;
OUT_NUM := V_NUM;
COMMIT;
END;
controller调用如下:
var inputParameter = new OracleParameter(":IN_NUMBER", OracleDbType.Int32, 100, input.inNum, ParameterDirection.Input);
var outputParameter = new OracleParameter(":OUT_NUM", OracleDbType.Varchar2, 20, ParameterDirection.Output);
// 执行存储过程
_context.Database.ExecuteSqlRaw("BEGIN HOSPITAL.S_TEST_TIME(:IN_NUMBER, :OUT_NUM); END;",
inputParameter,
outputParameter);
// 获取输出参数的值并处理
var outputValue = outputParameter.Value.ToString();
Input2 input2 = new Input2();
input2.inNum = Convert.ToInt32(outputValue);
return Ok(input2);
outputParameter.Value值为空,有没有大佬帮忙看看是哪个地方处理错误了,过程是调用成功的数据插入了,但是就是取不到返回值