Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Truncate Qs
Thanks everyone for the answer
Prabal
From: Brian MacLean <bmaclean_at_homebid.com>
Reply-To: ORACLE-L_at_fatcity.com
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
Subject: RE: Truncate Qs
Date: Tue, 20 Jun 2000 13:58:07 -0800
Taken from Oracle8i SQL Reference Release 8.1.5 A67779-01 at http://sitelicense.arizona.edu/~oradoc/DOC/server.815/a67779/ch4m.htm#13607
Restrictions:
You cannot truncate the parent table of an enabled referential integrity constraint. You must disable the constraint before truncating the table. (Anexception
self-referential.)
Brian P. Mac Lean
Senior Oracle Database Administrator
OCPv8/Oracle Master
HomeBid.Com
8700 N. Gainey Center Drive
Scottsdale, AZ 85258
Tel:480.609.4624 Cel:602.617.6075 Fax:480.609.4646 Net:brian.maclean_at_homebid.com
-----Original Message-----
Sent: Tuesday, June 20, 2000 1:13 PM
To: Multiple recipients of list ORACLE-L
Hello,
Can someone please explain me this:
I tried to truncate a table, it gave ORA-2266.
But when I deleted the rows, it did not show the error. And after deleting
the rown I tried to truncate the table again, but it still gives ORA-2266
TIA
Prabal
SQL> truncate table supplier_order;
truncate table supplier_order
*
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys
SQL> delete supplier_order;
97 rows deleted.
SQL> truncate table supplier_order;
truncate table supplier_order
*
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys
-- Author: Prabal Biswas INET: willsm_at_hotmail.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists ________________________________________________________________________Received on Wed Jun 21 2000 - 08:22:11 CDT