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