I have a linq to entities query (EF 4.3)
var query = from item in db.TableTest
select item.VAL;
which translates to this SQL statement
SELECT
"Extent1"."VAL" AS "VAL"
FROM "dbo"."TEST_TABLE" "Extent1"
The database is Oracle.
When I execute the query I get the message that the datatable does not exist. The problem is the ("dbo") part. If i remove it and execute this query directly (not through LINQ but through an oracleconnection etc)
SELECT
"Extent1"."VAL" AS "VAL"
FROM "TEST_TABLE" "Extent1"
then everything is ok. I get values back.
How can I instruct Linq To Entities to output Oracle compatible SQL?
Assuming you have an entity model, make sure you correctly set the DDL generation template.
Also, you can remove the dbo for the database schema name to match your actual DB.

Shortly after asking, i found a way to solve my problem
I had this POCO class
[Table("TEST_TABLE")]
public class MyEntity
{
[Key, Column("VAL")]
public string key_valye { get; set; }
}
The generated sql injected the "dbo". When i changed the table attribute to
[Table("TEST_TABLE", Schema="ATT")]
This generated the "ATT"."TEST_TABLE" instead, which was actually the correct sql.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With