Wrong datatype on bind variable
875220Mar 12 2012 — edited Mar 15 2012We are testing entity framework with ODP.NET and linq to entities and are having a bit of a problem.
We are running a simple linq to entities statement with a bind variable and our problem is that the column in the oracle database is of the type CHAR but entity framework is sending the bind variable in as NVARCHAR2. This causes oracle to not use the index on the column and instead run a full table scan.
The entities are generated from the database.
Linq:
public string Name(string value)
{
var subject = (from s in ctx3.TABLE
where s.COLUMN1== value
select s.COLUMN2).ToList();
return subject[0].ToString();
}
Is there a way to define the datatype for a bind variable when using linq?
Edited by: 872217 on Mar 13, 2012 4:42 AM