oracle – 在实体框架中映射SYS_REFCURSOR

前端之家收集整理的这篇文章主要介绍了oracle – 在实体框架中映射SYS_REFCURSOR前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图通过Entity Framework访问Oracle 11g上的存储过程.我可以访问返回标量的存储过程,并返回正确的值.但是,当使用SYS_REFCURSOR返回结果集时,在函数导入时未检测到OUT参数.

我的存储过程如下

create or replace PROCEDURE "GetAllClientNames" (
  "ID" IN NUMBER,"SAL" IN NUMBER,"EMP_CURSOR" OUT SYS_REFCURSOR) IS

BEGIN 


    OPEN EMP_CURSOR FOR SELECT FIRSTNAME FROM CLIENTS;

END;

但是在更新实体并执行函数导入时,导入的函数中未检测到SYS_REFCURSOR OUT参数以检索结果集.

请帮我解决这个问题.没有OUT参数我无法访问存储过程检索的结果集

现在oracle数据提供程序允许这种操作没有太多的喧嚣.它在这里过于精心回答.添加快速阅读.请按照以下链接获取详细信息.

ODP.NET 11g Release 2 (11.2.0.3.0),and higher,enables applications
to run stored procedures with REF CURSOR parameters without using
explicit binding for these parameters in the .NET code.

For a read-only result set,such as a REF CURSOR using
OracleDataReader,REF CURSOR schema information is retrieved
automatically.

For some scenarios,such as when updateable REF CURSORs or Entity
Framework is used,developers need to define the REF CURSOR schema
information so that the application can bind the implicit REF CURSOR.
Entity Framework applications use implicit REF CURSOR binding to
instantiate complex types from REF CURSOR data. Applications must
specify REF CURSOR bind and Metadata information in the app.config,
web.config,or machine.config .NET configuration file.

The attributes supplied in the .NET configuration file are also used
when the application requests for schema information from the
OracleDataReader object that represents a REF CURSOR. This means that
for REF CURSORs that are created using a SELECT from a single table,
the application can update that table through the use of
OracleDataAdapter and OracleCommandBuilder.

When using the Entity Framework,function imports can return an
implicitly-bound REF CURSOR. The REF CURSOR can be returned as a
collection of complex types or entity types. To return a complex type
collection,the .NET configuration file needs to define the REF CURSOR
bind and Metadata information. To return an entity type collection,
only the bind information needs to be defined in the .NET
configuration file.

查找完整信息here

猜你在找的Oracle相关文章