For Oracle stored procedures, entity framework cannot "add function import."

entity-framework oracle recordset stored-procedures

Question

I am using Entity framework with following tools:

  1. MS Visual studio 2010 Professional SP1

  2. Latest Oracle data provider from Oracle website. (ODAC 11.2 Release 4 (11.2.0.3.0) for 32 bit) Downloaded it from http://www.oracle.com/technetwork/topics/dotnet/index-085163.html

  3. Oracle 11g server

My table looks as follows

enter image description here

my stored proc looks as follows:

PROCEDURE "GET_SUPPLIERS" (
    "SUPP_LIST" OUT SYS_REFCURSOR) IS
BEGIN 

    OPEN SUPP_LIST FOR 
    SELECT 
        SUPPLIER_NAME 
    FROM 
        A_SUPPLIER  ;

END;

I updated app.config for my entity framework project as follows:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="Entities" connectionString="tookitoutfromhere" />
  </connectionStrings>


  <oracle.dataaccess.client>
    <settings>
      <add name="FSDEVTL.GET_SUPPLIERS.RefCursor.SUPP_LIST" value="implicitRefCursor bindinfo='mode=Output'" />
      <add name="FSDEVTL.GET_SUPPLIERS.RefCursorMetaData.SUPPLIER_NAME.Column.0" value="implicitRefCursor metadata='ColumnName=SUPPLIER_NAME;BaseColumnName=SUPPLIER_NAME;BaseSchemaName=FSDEVTL;BaseTableName=A_SUPPLIER;NATIVEDATATYPE=Varchar2;ProviderType=Varchar2'" />
    </settings>
  </oracle.dataaccess.client>


</configuration>

I execute the following steps:

Under my .edmx project -> Model.Store -> Stored Procedures -> GET_SUPPLIERS

right click the stored procedure "GET_SUPPLIERS" choose "add function import" Function Import name and Stored procedure name are pre populated Under Returns a collection of I choose Entities as a_supplier which is the imported Oracle table. Then I click on "Get column information" button.

I get a response called "The selected stored procedure retuns no columns."

Please help.

enter image description here

I would like to be able to get recordset from stored procedure into my .net classes via entity framework.

Thanks

1
3
3/26/2012 7:35:14 PM

Accepted Answer

Please choose complex in "returns a collection of" and try again.

Example in "Function Imports and Retrieving Implicit Resultsets | Inserting and Updating Data Directly"

http://download.oracle.com/oll/obe/EntityFrameworkOBE/EntityFrameworkOBE.htm#t9

2
6/22/2012 6:16:16 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow