2

我在项目中使用带有 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是我绑定结果集的实体请帮助。

4

1 回答 1

2

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

<oracle.dataaccess.client
    <settings>
      <add name="rp.usp_RotaPlateProductie_Select.RefCursor.p_productieData" value="implicitRefCursor bindinfo='mode=Output'" />...
   <settings>
</oracle.dataaccess.client
于 2012-08-01T07:54:30.177 回答