Error in upDATE script -2292 ORA-02292: integrity constraint violated - ch
Ade2May 14 2013 — edited May 14 2013Hi friends, I have parent child table, I am trying to update both the parent record and the chlid records
create table table1 (id number not null,
Num Varchar2(6) not null,
type varchar2(1) not null);
create table table1 (id number not null,
Num Varchar2(6) not null,
type varchar2(1) not null);
Create table table2 (id number not null,
P_id number not null,
constraint fk foreign key reference table1 (id),
p_num Varchar2(6) not null
p_type Varchar2(1) not null);
Alter table child ADD (CONSTRAINT FK_1
FOREIGN KEY (p_num, p_type)
REFERENCES Table1 (Num,Type);
Update table1
set num = 'WHALE',
type = 'P'
WHERE id =1
Update table2
set p_num = 'WHALE',
p_type = 'P'
and p_id = 1
because there are records in table2, I am getting
ORA-02292: integrity constraint (FK_1) violated - child record found , what how can I resolve this?