Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: foreign key problem
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
![]() |
![]() |