Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Truncate Qs
Sounds like there is a foreign key enabled with a cascade delete to a child
table. Which means, when you do a delete, it also takes care of the data
in children tables and deletes it there too. Truncate will not take care
of data in the children tables hence the error message. Either get rid of
the constraint, or just do the delete.
take care,
Christine Turner
Database Administrator
IPS-Sendero
Scottsdale, Arizona
Phone: (800) 321-6899 ext. 3286
Fax: (480) 946-8224
E-mail: christine.turner_at_ips-sendero.com
-----Original Message-----
From: Prabal Biswas [SMTP:willsm_at_hotmail.com] Sent: Tuesday, June 20, 2000 1:13 PM To: Multiple recipients of list ORACLE-L Subject: Truncate Qs
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 -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Tue Jun 20 2000 - 08:23:17 CDT