You can create an exceptions table and re-execute your statement adding
the exceptions into exceptions clause -- assuming your exceptions table
is named exceptions. You can then identify the orphaned records by
rowid.
The script is probably named something like ?/rdbms/admin/utlexcpt.sql
(close enough).
select * from exceptions;
SELECT * FROM &child_table_name WHERE ROWID IN (SELECT ROW_ID FROM
EXCEPTIONS);
Joel Patterson
Database Administrator
joel.[Email address protected]
x72546
904 727-2546
-----Original Message-----
From: sandeep
[mailto:oracledba-ezmlmshield-x52494088.[Email address protected]
Sent: Wednesday, October 31, 2007 12:59 AM
To: LazyDBA Discussion
Subject: Error while altering table to add foreign key
Hi Everyone,
While altering table to add a foreign key I am following error. Can
someone help me in tracking this error?
SQL> alter table emp add constraint sandy foreign key(id) references
loc(id);
alter table emp add constraint sandy foreign key(id) references loc(id)
*
ERROR at line 1:
ORA-02298: cannot validate (PMR.SANDY) - parent keys not found
Br,
Sandeep
The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.
www.wipro.com
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
Oracle LazyDBA home page