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: Peter Laursen <ptl_at_edbgruppen.dk>
Date: 3 Sep 1999 09:48:46 GMT
Message-ID: <01bef5fa$1c13c780$2c289a0a@apollo>


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

Original text of this message

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