Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problems with Truncate Table
It could be that the table is referenced with on delete cascade. In that
case the delete works, but the truncate does not.
SQL> create table z(a int primary key);
Tabel er oprettet.
SQL> create table x(b int primary key, c int references z on delete cascade);
Tabel er oprettet.
SQL> truncate table z;
truncate table z
*
FEJL i linie 1:
ORA-02266: tabel har unikke/primære nøgler, der refereres til af aktiverede
fremmede nøgler
SQL> delete from z;
0 rækker er slettet.
Sorry for the danish text
Peter Laursen
Anurag Minocha <anurag_at_synergy-infotech.com> skrev i artiklen
<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 - 04:48:46 CDT
![]() |
![]() |