This discussion is archived
2 Replies Latest reply: Oct 5, 2012 5:38 AM by 966155 RSS

Entityframework 5 codefirst and Oracel SP

966155 Newbie
Currently Being Moderated
I am trying to call an Oracle SP from my Asp.net application which uses the Entity Framework Code-First approach.
This SP has 4 i/p paramaters and a ref_cursor O/p paramater.
Can you pls help me in getting started by giving some pointers on how I should be doing this?How do I pass parameters and get teh results in a list.
This i what i tried till now: but i get an error "Invalid SQL"

using Oracle.DataAccess;
using Oracle.DataAccess.Client;

OracleParameter outParam = new OracleParameter();
outParam.ParameterName = "FIRST_NAME_IN";
outParam.OracleDbType = OracleDbType.Varchar2;
outParam.Size = 25;
outParam.Direction = System.Data.ParameterDirection.Input;

var data = db.Database.SqlQuery<User>("EXEC SP_TEST").ToList();

Pls help me on this...

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points