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

Home -> Community -> Usenet -> c.d.o.server -> Re: foreign key problem

Re: foreign key problem

From: Sylvain Leclerc <SLeclerc_at_magrit.com>
Date: Tue, 28 Jul 1998 08:39:16 -0400
Message-ID: <044CD796C702D111B56800608CCC51D007056B@INT_04>


TRUNCATE is a DDL command that does not verify the integrity constraints.
If one exists, the command fails. If you want to use truncate you need to
drop your constraints first.

Sylvain Leclerc
sleclerc_at_magrit.com

> -----Original Message-----
> From: Gregory Lipman [SMTP:Gregory.Lipman_at_fmr.com]
> Posted At: Monday, July 27, 1998 3:15 PM
> Posted To: server
> Conversation: foreign key problem
> Subject: foreign key problem
>
> Hi
>
> I have one master table with primary key say a1
> and I have a number of child table that have foreign keys to a1.
>
> I first truncate all child tables.
> Then I try to TRUNCATE master table. Here is what I get :
> ================================================
> SQL> truncate table t_emp ;
> truncate table t_emp
> *
> ERROR at line 1:
> ORA-02266: unique/primary keys in table referenced by enabled foreign
> keys
> ++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> But isnt referential integrity kicks in only there is actual data in
> child tables ??!!
>
> Thanks
Received on Tue Jul 28 1998 - 07:39:16 CDT

Original text of this message

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