Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Wrong datatype on bind variable

875220Mar 12 2012 — edited Mar 15 2012
We 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
This post has been answered by 15208 on Mar 14 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 12 2012
Added on Mar 12 2012
2 comments
731 views