Hi,
Issue - unable to run the oracle stored procedure.
Using entity framework core (fluent api) how to run an oracle stored procedure which returns a result. The below is the sample. But I am getting this exception -Devart.Data.Oracle.OracleException: 'ORA-01036: illegal variable name/number'
using (DatabaseContext db = new DatabaseContext())
{
OracleParameter curParam = new OracleParameter();
curParam.ParameterName = "curParam";
curParam.Direction = ParameterDirection.Output;
curParam.OracleDbType = OracleDbType.Cursor;
List<IDENTITYCLAIM> result = await db.IdentityClaimModel.FromSql("EXECUTE RETAIL.GET_IdentityClaim_PROC", new object[] { curParam }).ToListAsync();
}
Thanks.
Srinivas
dotConnect for Oracle Stored Procedure
Re: dotConnect for Oracle Stored Procedure
Please call your stored procedure via anonymous PL/SQL block:
Another way is to redesign your appoach to use Oracle pipelined function: viewtopic.php?t=34719.
Code: Select all
List<IDENTITYCLAIM> result = await db.IdentityClaimModel.FromSql("begin RETAIL.GET_IdentityClaim_PROC(:curParam); end;", new object[] { curParam }).ToListAsync();