Oracle 对此列列表没有匹配的唯一键或主键

Oracle no matching unique or primary key for this column-list

Error starting at line : 25 in command -
CREATE TABLE Note (
    Note_ID NUMBER,
    Engineer_ID NUMBER,
    Project_ID NUMBER,
    Bug_ID NUMBER,
    Bug_Name varchar2(30),
    CONSTRAINT Note_PK PRIMARY KEY (Note_ID),
    FOREIGN KEY (Engineer_ID) REFERENCES Engineer(Engineer_ID),
    FOREIGN KEY (Project_ID) REFERENCES Project(Project_ID),
    FOREIGN KEY (Bug_ID) REFERENCES Bug(Bug_ID),
    FOREIGN KEY (Bug_Name) REFERENCES Bug(Bug_Name)
)
Error report -
ORA-02270: no matching unique or primary key for this column-list
02270. 00000 -  "no matching unique or primary key for this column-list"
*Cause:    A REFERENCES clause in a CREATE/ALTER TABLE statement
           gives a column-list for which there is no matching unique or primary
           key constraint in the referenced table.
*Action:   Find the correct column names using the ALL_CONS_COLUMNS
           catalog view

似乎找不到解决此问题的方法...有人可以帮忙吗?需要尽快分配。我事先还有一些代码,但我似乎找不到任何问题:?

错误信息很清楚。对于 table 中定义的每个外键,引用的 table 列需要是 uniqueprimary key.

因此您要确保以下所有 table 列都符合此要求:

Engineer(Engineer_ID)
Project(Project_ID)
Bug(Bug_ID)
Bug(Bug_Name)

很可能,问题出在第 Bug_Name 列;我猜想这个信息在功能上依赖于 Bug_ID,它已经被外键引用:如果是这样,那么你不需要将它存储在 Note table (您可以通过 Bug_ID 外键访问它。