Search code examples
c#entity-frameworkdevartdotconnect

Call Oracle stored procedures using devart dotConnect


I'm new in Entity Framework and trying to call oracle stored procedures, but without success. So Here is my question:

How to call oracle stored procedures using devart dotConnect?

For example, I have stored procedure:

procedure get_problems(res out sys_refcursor) is
  begin

   open res 
   for
   select id, name
   from problems;  

  end;

And from C# I'm tying to call:

 using (Entities entities = new Entities())
 {
     ObjectParameter res = new ObjectParameter("res", typeof(byte[]));
     ObjectResult<PROBLEM> problems = entities.SelectAllProblems(res);
 }

But it throws "EntityCommandExecutionException":

An error occurred while executing the command definition. See the inner exception for details.

Here is the inner exception:

ORA-06550: line 2, column 3:\nPLS-00306: wrong number or types of arguments in call to 'GET_PROBLEMS'\nORA-06550: line 2, column 3:\nPL/SQL: Statement ignored

I used

"typeof(byte[])"

as ObjectParameter type, because I saw this in Devart Entity Developer's generated code.

p.s. By the way, how will you recommend dotConnect in large projects?


Solution

  • Take a look at this article in our blog.
    You can contact us using our Forums or Feedback Page.