Page 1 of 1

dotConnect for Oracle Stored Procedure

Posted: Wed 07 Jun 2017 06:39
by SrinivasPulla
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

Re: dotConnect for Oracle Stored Procedure

Posted: Fri 09 Jun 2017 10:07
by Shalex
Please call your stored procedure via anonymous PL/SQL block:

Code: Select all

List<IDENTITYCLAIM> result = await db.IdentityClaimModel.FromSql("begin RETAIL.GET_IdentityClaim_PROC(:curParam); end;", new object[] { curParam }).ToListAsync();
Another way is to redesign your appoach to use Oracle pipelined function: viewtopic.php?t=34719.