我是 Entity Framework 的新手,并试图调用 oracle 存储过程,但没有成功。所以这是我的问题:
如何使用 devart dotConnect 调用 oracle 存储过程?
例如,我有存储过程:
procedure get_problems(res out sys_refcursor) is
begin
open res
for
select id, name
from problems;
end;
从 C# 我想打电话给:
using (Entities entities = new Entities())
{
ObjectParameter res = new ObjectParameter("res", typeof(byte[]));
ObjectResult<PROBLEM> problems = entities.SelectAllProblems(res);
}
但它抛出“EntityCommandExecutionException”:
执行命令定义时发生错误。有关详细信息,请参阅内部异常。
这是内部异常:
ORA-06550:第 2 行,第 3 列:\nPLS-00306:调用“GET_PROBLEMS”时参数的数量或类型错误\nORA-06550:第 2 行,第 3 列:\nPL/SQL:语句被忽略
我用了
“类型(字节[])”
作为 ObjectParameter 类型,因为我在 Devart Entity Developer 生成的代码中看到了这一点。
ps 顺便问一下,你会如何在大型项目中推荐 dotConnect?