dotConnect for Oracle Stored Procedure

dotConnect for Oracle Stored Procedure

Postby SrinivasPulla » Wed 07 Jun 2017 06:39


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();

Posts: 1
Joined: Wed 07 Jun 2017 06:34

Re: dotConnect for Oracle Stored Procedure

Postby Shalex » Fri 09 Jun 2017 10:07

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:
Devart Team
Posts: 7530
Joined: Thu 14 Aug 2008 12:44

Return to dotConnect for Oracle