Re: Help: how to interpret constraint errors?
Date: 1996/08/13
Message-ID: <rlogg.839922302_at_toon>#1/1
Vijay Vardhineni 604-1835 <vvardh01> writes:
>This is a multi-part message in MIME format.
>---------------------------------192271742656684867379278272
>Content-Transfer-Encoding: 7bit
>Content-Type: text/plain; charset=us-ascii
>Execute the following statement to see the list of constraints
>and it's associated tables
>select
> a.table_name fk_table,
> a.r_constraint_name,
> b.table_name
>from
> dba_constraints a,
> dba_constraints b
>where
> a.owner = upper('&owner') and
> a.r_constraint_name = b.constraint_name;
>vijay Vardhineni
>Oracle DBA
>EDS, PLANO
>---------------------------------192271742656684867379278272
>Content-Transfer-Encoding: 7bit
>Content-Type: text/plain
>From: agregory_at_concentric.net (Alastair Gregory)
>Newsgroups: comp.databases.oracle
>Subject: Help: how to interpret constraint errors?
>Date: 2 Aug 96 21:39:15 GMT
>Organization: MCI Communications
>Mime-Version: 1.0
>Content-Type: text/plain
>Content-Transfer-Encoding: 7bit
>Message-ID: <32027583.766D_at_concentric.net>
>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
Hope this learns you that NAMING your constraints is a wise thing. Next time if you define a constraint use the format ALTER TABLE .... ADD CONSTRAINT <USEFUL NAME OF CONSTRAINT> etc..
Hope this helps :-),
Roeland
-- // =========================================================================== // Roeland Loggen (rlogg_at_ctp.com) After being built and asked "is there a god" // Cambridge Technology Partners the supercomputer replied "well...... // Cambridge MA (617)-374-8788 there wasn't one, but now there is"Received on Tue Aug 13 1996 - 00:00:00 CEST