Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA - 02291, ORA - 02292 Errors

444621Nov 21 2007 — edited Nov 21 2007
Gurus,

When I run the following update statement, I got the following error

update dept
set deptno = 50
where deptno = 20

ORA - 02292: Integrity constraint(SCOTT.FK_DEPTNO) violated - Child record found

######################################################
When I run the following update statement, I got the following error

update emp
set deptno = 50
where deptno = 20

ORA - 02291: Integrity constraint (SCOTT.FK_DEPTNO) violated - parent key not found

I need couple of things here:
1. I want to update the dept table deptno
2. If I update the dept.deptno, corresponding child rows emp.deptno also needs to be update with new values.

How can I do this ?
Thanks.
S
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 19 2007
Added on Nov 21 2007
5 comments
1,793 views