Message-Id: <10534.109914@fatcity.com> From: Brian MacLean Date: Tue, 20 Jun 2000 13:51:38 -0700 Subject: RE: Truncate Qs This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01BFDAF9.54AFE06C Content-Type: text/plain; charset="windows-1252" 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. (An exception is that you may truncate the table if the integrity constraint is 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@homebid.com -----Original Message----- From: Prabal Biswas [mailto:willsm@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 ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com -- Author: Prabal Biswas INET: willsm@hotmail.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists ------_=_NextPart_001_01BFDAF9.54AFE06C Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: quoted-printable RE: Truncate Qs

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:
         &nb= sp;           &nb= sp; You cannot truncate the parent table of an enabled referential = integrity constraint. You must disable the

         &nb= sp;           &nb= sp; constraint before truncating the table. (An exception is that you = may truncate the table if the integrity constraint is

         &nb= sp;           &nb= sp; 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@homebid.com


         &nb= sp;        

-----Original Message-----
From: Prabal Biswas [mailto:willsm@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
         &nb= sp;     *
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
         &nb= sp;     *
ERROR at line 1:
ORA-02266: unique/primary keys in = table referenced by enabled foreign keys

_________________________________________________________= _______________
Get Your Private, Free E-mail from = MSN Hotmail at http://www.hotmail.com

--
Author: Prabal Biswas
  INET: = willsm@hotmail.com

Fat City Network = Services    -- (858) 538-5051  FAX: (858) = 538-5051