title: Calling an Oracle stored procedure with Entity Framework code-first and DevArt Drivers
body: <p>I have an Oracle stored procedure that I am trying to call with EF code-first (<code>DbContext</code>) using the DevArt Oracle drivers (latest version). I don't know why this has to be so hard (I wish I was using SQL Server), but I cannot make it work. I am doing what is described in <a href="https://stackoverflow.com/questions/21965605/how-to-call-a-stored-procedure-inside-an-oracle-package-with-entity-framework">this post</a></p>
  
  <p>I followed the answer that was supplied by the DevArt team themselves, and I still get an Oracle exception, albeit slightly different:</p>
  
  <blockquote>
    <p>ora-01036 illegal variable name/number</p>
  </blockquote>
  
  <p>Here's the signature of my stored procedure:</p>
  
  <pre><code>create or replace PROCEDURE GP_PARTICIPANTDETAILS 
  (
    p_contracts_list VARCHAR2,
    p_participant_type CHAR DEFAULT NULL,
    p_dob_range_begin DATE DEFAULT NULL,
    p_dob_range_end DATE DEFAULT NULL,
    p_part_name VARCHAR DEFAULT NULL,
    p_ssn VARCHAR DEFAULT NULL,
    p_status_list VARCHAR2 DEFAULT NULL,
    p_start_index IN INT DEFAULT 0, 
    p_records_to_take IN INT DEFAULT 0,
    cp_result OUT SYS_REFCURSOR
  )
  </code></pre>
  
  <p>I'm creating all my parameters like this (won't bother to put them all here because there are so many, but I define name, value, type, and direction for all)</p>
  
  <pre><code>OracleParameter paramContracts = new OracleParameter("p_contracts_list",  OracleDbType.VarChar, contracts.ToString(), System.Data.ParameterDirection.Input);   
  </code></pre>
  
  <p>The cursor parameter is defined like this:</p>
  
  <pre><code>OracleParameter paramOutputCursor = new OracleParameter("cp_cresult", OracleDbType.Cursor, System.Data.ParameterDirection.Output);      
  </code></pre>
  
  <p>Then I call it like this:</p>
  
  <pre><code>string sqlQuery = "BEGIN OMNIDB.GP_PARTICIPANTDETAILS(:p_contracts_list, :p_participant_type, :p_dob_range_begin, :p_dob_range_end, :p_part_name, :p_ssn, :p_status_list, :p_start_index, :p_records_to_take, :cp_result); END;";
  
  var details = context.Database.SqlQuery&lt;ParticipantDetail&gt;(sqlQuery, paramContracts, paramPartType, paramDobBegin, paramDobEnd, paramPartName, paramSSN, paramStatuses, paramStartIndex, paramRecordsToTake, paramOutputCursor).ToList();    
  </code></pre>
  
  <p>Everything I try gives the same error. With the <code>:</code> before the param name, without the <code>:</code>... I verified the spelling of the params in the code match the declaration of the procedure.  </p>
  
  <p>What's wrong here?</p>