Column ambiguously defined ORA-00918
See original GitHub issueThe 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()`
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
ORA-00918: column ambiguously defined tips
ORA-00918 column ambiguously defined. Cause: A column name used in a join exists in more than one table and is thus referenced ambiguously....
Read more >ORA-00918: column ambiguously defined
The source of an ORA-00918 error comes from a mistake when attempting to join two or more tables that share the same name...
Read more >ORA-00918: column ambiguously defined in SELECT
The solution is quite simple: you will have to expand the projection to explicitly select named columns. Then you can either leave out...
Read more >Oracle / PLSQL: ORA-00918 Error Message
Cause. You tried to execute a SQL statement that joined two or more tables, where a column with the same name exists in...
Read more >ERROR: "ORA-00918: column ambiguously defined" is seen ...
This issue is caused by a duplication in the table definitions when 'Support mixed-case identifiers' is selected in the connection properties of ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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"))
Interesting that it worked for you. I’m still getting the same error with Oracle 12.1.0.2 Running application is net5.0, within startup:
DBContext is within another library, netstandard2.1
I tried using the EF package versions you specified, still with no resolution. When I repoint to a local 18XE though, it does work just fine.
Also - Is there something that would possibly need to be configured on the 12.1 server for b.UseOracleSQLCompatibility(“11”) to actually work?