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: Truncate fail, delete OK...

Re: Truncate fail, delete OK...

From: <mrs_gleeson_at_my-deja.com>
Date: Tue, 02 Nov 1999 19:19:21 GMT
Message-ID: <7vndfk$ckl$1@nnrp1.deja.com>


In article <7vn90g$90i$1_at_nnrp1.deja.com>,   alan_psb_at_yahoo.com wrote:
>
>
> Table Children has foreign key referenced to Table Mother.
>
> Now, truncate table Children and no problem.
>
> Next, truncate table Mother and failed. The error message indicate the
> foreign key constraint violated. (Mother has only one table Children
> referenced to her)
>
> Later, delete from table Mother and it is OK.
>
> Why I cannot truncate table Mother when the table Children has no
> record? What should I do such that I can use truncate statement on
table
> Mother (except drop table Children, disable constraint)
>
> Thanks,
> Alan
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

Okay I am going to give you my wonderful guess. I think you need to select (all the constraints) on the table by looking into (DBA_CONSTRAINTS)
After finding the constraint name that references the children table. You
need to alter it to be Disabled. Then and only then you can Truncate the table. I guess truncation deals w/ the table structure; And as far as the database's concern, the table has children tide to it through the enabled constraint.
That's the best guess I could give you and I believe it's correct ;) Good Luck.

--MRS. Gleeson

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Nov 02 1999 - 13:19:21 CST

Original text of this message

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