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: Problems with Truncate Table

Re: Problems with Truncate Table

From: Bob Fazio <bob_fazio_at_hotmail.com.no.spam>
Date: Fri, 03 Sep 1999 11:37:47 GMT
Message-ID: <fqOz3.2753$E46.5179@news.rdc1.pa.home.com>


The table that you are trying to truncate is the parent to a referencial constraint.

The reason that truncate is so fast is that it doesn't check anything, it just marks all rows as deleted and moves the high watermark. This leads to your problem. If it doesn't check to see if you can delete the rows, the only alternative is to not let you do it, because you may violate the constraint that you have on the table. Even if there are no rows in the other table.

--
Bob Fazio
Remove no.spam from my email to reply

Anurag Minocha <anurag_at_synergy-infotech.com> wrote in message news:37CF8E89.ACE033BC_at_synergy-infotech.com...
> Hi,
> I am using the Truncate command but it doesnt work, whereas delete works
> fine for the same table.
>
> Here is what I am doing
>
> SQL>Truncate table test;
> Error at line 1:
> ORA-02266:Unique/Primary Keys in table refernced by enabled foreign key.
>
> But when i issue the following command it executes file
>
> sql>delete from test;
> 100 rows deleted.
>
>
> Can somebody point out the problem please.
>
> Thanks
> anurag
>
> also reply at
> anurag_at_synergy-infotech.com
>
>
Received on Fri Sep 03 1999 - 06:37:47 CDT

Original text of this message

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