Re: Help: how to interpret constraint errors?

From: Ken Mizuta <kmizuta_at_jp.oracle.com>
Date: 1996/08/07
Message-ID: <32090002.15F_at_jp.oracle.com>#1/1


Alastair Gregory wrote:
>
> Hello, Oracle gurus!
>
> Can anyone tell me how to take an ORACLE 7 error message
> such as
>
> ORA-02291: integrity constraint (userid.SYS_C002776) violated -
> parent key not found
>
> and map the code SYS_C002776 back to identify which field
> (in the table being inserted into) is the one which fails
> the constraint check, and which table holds the (missing)
> parent record? I know the answer is somewhere in the system
> tables, but I don't know enough about them :(
>
> Please mail any hints to: gregorya_at_iia.org or
> agregory_at_concentric.net
>
> Thanks!!
> Alastair Gregory

This should get you the name of the table that the parent key is on.

 select table_name from all_constraints where  constraint_name in (select r_constraint_name from user_constraints  where constraint_name='SYS_C002776');

-- 
                  ____________________________________________ 
                 /    Kenichi Mizuta 
      ////      /     Oracle Corporation (Redwood Shores, CA) 
     |0 0|     /      Applications Division 
_ooO_ \U/_Ooo_/       email: kmizuta_at_us.oracle.com 
The comments and opinions expressed herein are mine and
do not necessarily represent those of Oracle Corporation.
Received on Wed Aug 07 1996 - 00:00:00 CEST

Original text of this message