title: Foreign key referencing a view in Oracle
body: <p>I'm attempting to reference a view with a foreign key but I am getting this error:</p>
  
  <p>"Error: ORA-02270: no matching unique or primary key for this column-list"</p>
  
  <p>However, I have created a primary key on this view and verified it in the Constraints tab in TOAD. </p>
  
  <p>This is the table I'm attempting to create:</p>
  
  <pre><code>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)
  );
  </code></pre>
  
  <p>SOME_VIEW is a view based on another view which points to the employee table in another schema. </p>