Skip to content

ORA-00918: column ambiguously defined #102

@Martin-Andersen

Description

@Martin-Andersen

Using Oracle 12C 12.1.0 with latest EF Core 3.1 provider

I am mapping to an existing user/schema/database (: and are not in charge of it.

I have a contact person that have a contact type.
I only have navigation to the ContactType

When I run this code

var contact = context.Contacts.Include(x=>x.Type).FirstOrDefault();

That produces this sql:

 fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
      Failed executing DbCommand (67ms) [Parameters=[], CommandType='Text', CommandTimeout='0']
      SELECT "c"."ID", "c"."TYPE", "c"."CUSTOMER", "c"."EMAIL", "c"."NAME", "c"."PHONE", "c0"."ID", "c0"."NAME"
      FROM "SAMSON"."CUSTOMER_CONTACT" "c"
      INNER JOIN "SAMSON"."CUSTOMER_CONTACT_TYPE" "c0" ON "c"."TYPE" = "c0"."ID"
      FETCH FIRST 1 ROWS ONLY

I have no problems running the sql:
Is it an error, or are my relation mapping wrong?

SELECT "c"."ID", "c"."TYPE", "c"."CUSTOMER", "c"."EMAIL", "c"."NAME", "c"."PHONE", "c0"."ID", "c0"."NAME"
FROM "SAMSON"."CUSTOMER_CONTACT" "c"
INNER JOIN "SAMSON"."CUSTOMER_CONTACT_TYPE" "c0" ON "c"."TYPE" = "c0"."ID";

contact_domain
contact_type_domain
samson_contact
contact_mapping
contact_type_mapping

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions