Create Table Resources_user
(
Resources_userID INTEGER NOT NULL,
Resources_ID INTEGER NOT NULL,
User_ID INTEGER NOT NULL,
Data Accessed DATE,
CONSTRAINT PK_Resources_user PRIMARY KEY (Resources_userID),
constraint fk_Resources_user1 Foreign key (Resources_ID ) references Resources,
constraint fk_Resources_user2 Foreign key (User_ID) references User1);
Create table Staff_Position
(
Staff_Position_ID INTEGER NOT NULL,
Position_ID INTEGER NOT NULL,
User_ID INTEGER NOT NULL,
CONSTRAINT PK_Staff_Position PRIMARY KEY (Staff_Position_ID),
Constraint fk_Staff_Position1 foreign key (Position_ID) references position,
Constraint fk_Staff_Position2 foreign key (User_ID) references User1);
谢谢你问题解决了,我意识到我需要编号我的外键以避免重复错误。
答案 0 :(得分:3)
您的外键约束不完整。您没有指定字段。这样:
, constraint fk_Resources_user Foreign key (Resources_ID ) references Resources
应该是这样的:
, constraint fk_Resources_user Foreign key (Resources_ID )
references Resources (resources_id)
某些Oracle错误消息具有误导性。这是其中之一。
编辑从这里开始
您的外键也有重复的约束名称。一旦其他问题得到解决,您可能会收到一条消息。