Oracle 违反错误en ORA-02291完整性约束(SYSTEM.SYS_C005494)-未找到主键

Oracle 违反错误en ORA-02291完整性约束(SYSTEM.SYS_C005494)-未找到主键,oracle,oracle10g,ora-02291,Oracle,Oracle10g,Ora 02291,这是我的代码: create table socio_recomendado( cc_soc2 number(10) not null, cc_socio_recomendado number(10) not null, foreign key(cc_soc2) references socio(cc_soc), foreign key(cc_socio_recomendado) references socio(cc_soc), constraint C_SOC check(cc_socio_

这是我的代码:

create table socio_recomendado(
cc_soc2 number(10) not null,
cc_socio_recomendado number(10) not null,
foreign key(cc_soc2)
references socio(cc_soc),
foreign key(cc_socio_recomendado)
references socio(cc_soc),
constraint C_SOC
check(cc_socio_recomendado != cc_soc2));

alter table socio_recomendado add primary key(cc_soc2,cc_socio_recomendado);
这是插入值的代码,但出现错误:

insert into socio_recomendado
values(1121955490,1121555490);

参考键指的是表。在SOCIO_RECOMENDADO表中插入值时,如果在SOCIO表中找不到该值,则会给出您提到的ORA错误


请先在Socia_RECOMENDADO表中插入值,然后再在Socia_RECOMENDADO表中插入值。

哦,好的,很抱歉你不懂西班牙语。不相关,但是:不要在
系统
架构中创建常规表。不要将
SYSTEM
SYS
用于常规工作。创建一个普通用户并在那里创建表。系统和系统帐户仅用于管理目的。不要将其用于您的正常工作