9

How to remove quotes in sql-code which is generated by Entity Framework? I use .NET 4.0, Oracle 11, Ef 5

protected override void OnModelCreating(DbModelBuilder modelBuilder)
{                    
    modelBuilder.Entity<ClassName>().ToTable("TableName", "SchemaName");
}

Entity Framework generate sql code:

SELECT "Extent1"."Field1" AS "Field1"        
FROM "SchemaName"."TableName" "Extent1"

I want remove quotes around "SchemaName", because in Oracle I get error "ORA-00942: table or view does not exist"

drlivsi
  • 143
  • 4
  • 9
  • Are you using the right ADO connector? – Gusman Apr 14 '14 at 01:44
  • Thank you Grant Winney. The solution is very simple, just to uppercase the user id and the schema name! – drlivsi Apr 14 '14 at 02:16
  • You should use Oracle ADO connector. This is a connectors job to generate SQL. If it's not working, well, you found a bug in the connector. I think there is no way around. – Jurion Apr 14 '14 at 03:07

1 Answers1

1

Quotes just enforce case-sensitive naming in Oracle SQL.

All you need here is to use correct case for schema, table and column names and it should work!

stop-cran
  • 4,229
  • 2
  • 30
  • 47