dotnet-db-samples: Column ambiguously defined ORA-00918
The code below results in ‘Column ambiguously defined ORA-00918’ This occurs if version of Oracle.EntityFrameworkCore is 3.19.80 Worked well in Oracle.EntityFrameworkCore 2.19.90
`class Order{ public int Id{get;set;} public DateTime? CompletionDate{get;set;} public bool IsActive{ var now = DateTime.Now return now<this.CompletionDate || CompletionDate==null; } }
class OrderDetail{ public int Id{get;set;} public int OrderId{get;set;} public Order Order{get;set;} }
(from od in db.OrderDetails.Include(d=>d.Order) select new {Id=od.Id, IsActive=od.Order.IsActive}).ToArray()`
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (5 by maintainers)
@danko007 You can avoid this bug, by configuring your db context to use SQL compatible with Oracle 11g, that doesn’t have this bug:
services.AddDbContext<yourDbContext>(options => options.UseOracle(yourDbConnectionString, b => b.UseOracleSQLCompatibility("11"))