Executing oracle store procedure using entity framework 5

Store Procedure is

create or replace PROCEDURE GETCORPORATEACTION(
RECORD_DATE IN date,
prc out sys_refcursor
)
AS
BEGIN
OPEN prc FOR SELECT *
FROM HR.CORPORATEACTION
where RECORDDATE = RECORD_DATE;
END;

Calling SP using EF:

var CorporateActions = db.GETCORPORATEACTION(recordDate);

Error is Message = "ORA-06550: line 1, column 8:\nPLS-00306: wrong number or types of arguments in call to 'GETCORPORATEACTION'\nORA-06550: line 1, column 8:\nPL/SQL: Statement ignored"

Kindly anyone suggest me how to get rid out of this problem.Thanks in Advance.

Upvotes: 0

Views: 308

Answers (1)

There are a couple of problems:

  1. The procedure being invoked takes two arguments but only one has been supplied. A variable for the second parameter should be given in the call.
  2. This is a procedure which is being called. Procedures do not return a value, but you've coded the call as if a function is being called.

The call should probably be something like

db.GETCORPORATEACTION(recordDate, CorporateActions);

Upvotes: 0

Related Questions