Unable to hit oracle stored proc using .Net EF(2.2) Core repository pattern

.net entity-framework-core oracle oracle-sqldeveloper repository-pattern

Question

ORA-00900: invalid SQL statement

This is the problem I see while attempting to call an Oracle stored procedure from my API.

I'm using Entity Framework and the Repository pattern. The EF Core 2.2

I'm making this call,

return FetchWithStoredProcedure("PROC_GETMYPROC",
     new OracleParameter("PARAM1", OracleDbType.Int32, ParameterDirection.Input) { Value = PageNo },
     new OracleParameter("PARAM2", OracleDbType.Int32,ParameterDirection.Input) { Value = PageSize },
     new OracleParameter("PARAM3", OracleDbType.Varchar2, 30, ParameterDirection.Input) { Value = SearchTerm },
     new OracleParameter("PARAM4", OracleDbType.Int32, ParameterDirection.InputOutput) { Value = TotalRows },
     new OracleParameter("PARAM5",OracleDbType.RefCursor, ParameterDirection.Output)
                     ).ToList();

This is how I fetch using a store procedure.

public IEnumerable<T> FetchWithStoredProcedure(string query, params object[] parameters)
{
    return _entities.Set<T>().FromSql(query, parameters);
}

This is the exception that was raised.

enter image description here

1
0
3/31/2020 2:53:10 PM

Popular Answer

ZZZ_tmp
0
4/1/2020 5:41:14 AM






Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow