实体框架和Oracle客户端 - 存储过程问题

时间:2012-06-29 09:38:27

标签: oracle entity-framework-4 plsql

我在项目中使用Entity Framework和Oracle,并尝试从EF调用存储过程。程序如

Create or Replace Procedure usp_RotaPlateProductie_Select(
    p_afdelingId in varchar2,
    p_productTypeId in varchar2,
    p_productieData out sys_refcursor)
IS 
Begin
    Open p_productieData for
        Select rp.Batchnummer, cppo.Productnummer, p.Omschrijving, pra.Bruto_In_Meters
        From Rotaplateproductie rp inner join Productieresultaatrtplrol pra
        on rp.Batchnummer = pra.Batchnummer inner join Cpiplusproductieorder cppo
        on pra.ProductieNummer = cppo.ProductNummer inner join Product p
        on cppo.Productnummer = p.Productnummer Where rp.Afdelingid = p_afdelingId
        and rp.producttype = p_productTypeId; 
END;

但是当EF执行该功能时,我收到错误

ORA-06550: line 1, column 8:
PLS-00306: wrong number or types of arguments in call to 'USP_ROTAPLATEPRODUCTIE_SELECT.
ORA-06550: line 1, column 8:
PL / SQL: Statement IGNORED.

我使用以下代码调用此过程

public ObjectResult<RotaPlateProductie> Search_RotaPlateProductie(global::System.String p_AFDELINGID, global::System.String p_PRODUCTTYPEID)
    {
        ObjectParameter p_AFDELINGIDParameter;
        if (p_AFDELINGID != null)
        {
            p_AFDELINGIDParameter = new ObjectParameter("P_AFDELINGID", p_AFDELINGID);
        }
        else
        {
            p_AFDELINGIDParameter = new ObjectParameter("P_AFDELINGID", typeof(global::System.String));
        }

        ObjectParameter p_PRODUCTTYPEIDParameter;
        if (p_PRODUCTTYPEID != null)
        {
            p_PRODUCTTYPEIDParameter = new ObjectParameter("P_PRODUCTTYPEID", p_PRODUCTTYPEID);
        }
        else
        {
            p_PRODUCTTYPEIDParameter = new ObjectParameter("P_PRODUCTTYPEID", typeof(global::System.String));
        }

        return base.ExecuteFunction<RotaPlateProductie>("Search_RotaPlateProductie", p_AFDELINGIDParameter, p_PRODUCTTYPEIDParameter);
    }

这里RotaPlateProductie是我绑定结果集的实体 请帮忙。

1 个答案:

答案 0 :(得分:2)

您必须添加配置;在您的情况下应如下:

<oracle.dataaccess.client
    <settings>
      <add name="rp.usp_RotaPlateProductie_Select.RefCursor.p_productieData" value="implicitRefCursor bindinfo='mode=Output'" />...
   <settings>
</oracle.dataaccess.client