-2

这是我的代码:

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);
4

1 回答 1

0

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

请先将值插入 SOCIO 表,然后再将值插入 SOCIO_RECOMENDADO 表。

于 2017-09-24T12:43:59.150 回答