I try to reference the view using a foreign key, but I get this error:
"Error: ORA-02270: there is no corresponding unique or primary key for this column list"
However, I created a primary key on this view and checked it on the "Constraints" tab in TOAD.
This is the table I'm trying to create:
CREATE TABLE QUESTION ( QUESTION_ID INTEGER not null, CREATED_USER_ID INTEGER not null, CONSTRAINT PK_QUESTION PRIMARY KEY (QUESTION_ID), CONSTRAINT FK_USER FOREIGN KEY (CREATED_USER_ID) REFERENCES SOME_VIEW(VIEW_ID) );
SOME_VIEW is a view based on another view that points to an employee table in a different schema.
sql oracle views foreign-keys
echoblaze Sep 30 '10 at 17:21 2010-09-30 17:21
source share