Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Truncate Qs

Re: Truncate Qs

From: Scott Shafer <scott.shafer_at_ildmail.com>
Date: Tue, 20 Jun 2000 15:44:24 -0500
Message-Id: <10534.109913@fatcity.com>


because constraints exist independent of data. If there are any foreign key relationships, you need to use "cascade constraints" which tells the db to ignore any key info...

--Scott

> Thanks Scott,
> I was just wondering if there is no data in the table, then also why
should
> truncate table give the error.
>
> To: <willsm_at_hotmail.com>
> Date: Tue, 20 Jun 2000 14:40:33 -0500
>
> truncate table <tabname> cascade constraints;
>
> ----- Original Message -----
> To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com>
> Sent: Tuesday, June 20, 2000 3:12 PM
>
>
> > 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_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).
>
>
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
> --
> 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
Received on Tue Jun 20 2000 - 15:44:24 CDT

Original text of this message

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