Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: can't delete row !

Re: can't delete row !

From: Michael Serbanescu <mserban_at_postoffice.worldnet.att.net>
Date: 1997/09/12
Message-ID: <5vah9f$bfb@bgtnsc03.worldnet.att.net>#1/1

What it means is that you are trying to delete a row in the table PAISES that is referenced in another table through a referential integrity constraint (FOREIGN KEY -> PRIMARY/UNIQUE KEY). The name of the constraint is SYS_C001148 (under the WOUSR schema).

To verify that and find out the name of the child table (the one that references PAISES, log on to SQL*Plus as WOUSER and execute the following SQL query:

SELECT table_name FROM user_constraints
WHERE constraint_name='SYS_C001148';

Your options are:

  1. Do not delete rows from PAISES
  2. Disable/drop the FOREIGN KEY constraint (ALTER TABLE <child_table_name> DISABLE/DROP CONSTRAINT SYS_C001148)
  3. Drop and re-create the FOREIGN KEY constraint SYS_C001148 with the ON DELETE CASCADE clause (this is called a referential action), so that when you delete a row in PAISES that has child row(s) in other table(s), those rows get deleted too. Make sure that is what you want !

Note that if you re-create the constraint and do not name it explicitly (as is the case with the current constraint), ORACLE assigns it a name in the format SYS_Cnnnnnn, but it will not be SYS_C001148.

Hope this helps.

Michael Serbanescu



Jordi Bellver wrote:
>
> Buenas !
>
> When I tried to delete one entry from Table 'paises' i get the
> error:
>
> ------------------------------------------------------------
> PL/SQL> delete from paises where id_pais='TODOS';
> ERROR 0 at line 1, column 0
> Unhandled exception ORA-02292: restricción de integridad
> (WOUSR.SYS_C001148)
> violada - registro hijo encontrado
>
> [integrity restriction violated . son register found]
>
> which was raised in a statement starting at line 1
> PDE-PXC002 Program unit execution aborted due to unhandled exception
> (2292).
> PDE-PUP001 ORA-02292: restricción de integridad (WOUSR.SYS_C001148)
> violada - registro hijo encontrado
> ------------------------------------------------------------
>
> I don't know what this means, or what to do to delete this row.
>
> this row REALLY exist !
>
> Can you help me, please ?
>
> Thank's in advance
>
> bye
Received on Fri Sep 12 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US