oracle sql: not able to add foreign key to table -> invalid identifier?

[亡魂溺海] 提交于 2019-12-06 08:11:31
Yahia

you are refereing to persid which is not a column in table species thus the error...

EDIT - As per comments:

It means that you need some column in species to be used as foreign key... if there is no such column then you need to build one in before you can create that constraint. Like this:

alter table species
add persid number(8) not null
;
alter table species
add constraint species_person_fk
foreign key (persid)
references person (persid)
;

Depending on your data model, SPECIES.PERSID may be optional or mandatory.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!