I have an oracle storage procedure that takes 2 lines and a date in the input parameter and which give the ref cursor as output:
CREATE OR REPLACE PROCEDURE SCHEMA.MYPROSTO ( pPl IN VARCHAR2,
The output cursor returns a set of three rows of string cells.
I imported this stored procedure in my entity framework model, with this in the .config file:
<oracle.manageddataaccess.client> <version number="*"> <implicitRefCursor> <storedProcedure schema="SCHEMA" name="MYPROSTO"> <refCursor name="PCURSOR"> <bindInfo mode="Output"/> <metadata columnOrdinal="0" columnName="YEAR" providerType="Varchar2" allowDBNull="true" nativeDataType="Varchar2"/> <metadata columnOrdinal="1" columnName="MONTH" providerType="Varchar2" allowDBNull="true" nativeDataType="Varchar2"/> <metadata columnOrdinal="2" columnName="COUNT" providerType="Varchar2" allowDBNull="true" nativeDataType="Varchar2"/> </refCursor> </storedProcedure> </implicitRefCursor> </version> </oracle.manageddataaccess.client>
The import wizzard function created a result object and generated an access function:
public virtual ObjectResult<MYPROSTO_Result> MYPROSTO (string pPL, string pTY, Nullable<System.DateTime> pDATE) { var pPLParameter = pPL!= null ? new ObjectParameter("PPL", pPL) : new ObjectParameter("PPL", typeof(string)); var pTYParameter = pTY!= null ? new ObjectParameter("PTY", pTY) : new ObjectParameter("PTY", typeof(string)); var pDATEParameter = pDATE.HasValue ? new ObjectParameter("PDATE", pDATE) : new ObjectParameter("PDATE", typeof(System.DateTime)); return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<MYPROSTO_Result>("MYPROSTO", pPLParameter, pTYParameter, pDATEParameter); }
However, calling this function throws an exception ( System.Data.Entity.Core.EntityCommandExecutionException ) in the last line:
ORA-06550: Ligne 1, colonne 8 : PLS-00306: wrong number or types of arguments in call to 'MYPROSTO' ORA-06550: Ligne 1, colonne 8 : PL/SQL: Statement ignored
I don't understand why he is failing
c # oracle stored-procedures entity-framework
Remy grandin
source share