I know there are many inquiries about this since I've had this problem for more than a week, but I haven't come across any that use Oracle. I want to construct an entity from an Oracle View using EF Database First, but EF won't allow me since it says "You need to declare a primary key."
My recent messages include:
Solutions I've tried:
I'll edit the.edmx file and add the main key. RESULT: The framework will say "That column is nullable, we can't accept that"
Change my viewpoint using the following phrasing:
CREATE OR REPLACE FORCE VIEW SCHEMA.MY_VIEW (COLUMN, FIELD1, FIELD2, FIELD3) AS SELECT NVL(ROW_NUMBER() OVER(ORDER BY FIELD1), 0) AS COLUMN , FIELD1 , FIELD2 , FIELD3 WITH READ ONLY; ALTER VIEW SCHEMA.MY_VIEW ADD CONSTRAINT MY_VIEW_PK PRIMARY KEY (CODIGO_MONEDA) RELY DISABLE;
I attempted many different iterations of the aforementioned query, adding NVL to the others column and making a main key. It simply won't work for me.