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: Alex Hillman <alex_hillman_at_physia.com>
Date: Wed, 21 Jun 2000 11:47:47 -0400
Message-Id: <10535.110012@fatcity.com>


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_01BFDB98.0C0892D0
Content-Type: text/plain;

        charset="iso-8859-1"

Cascade constraints option does not exist in truncate.

Alex Hillman

-----Original Message-----
From: Scott Shafer [mailto:scott.shafer_at_ildmail.com] Sent: Tuesday, June 20, 2000 5:58 PM
To: Multiple recipients of list ORACLE-L Subject: Re: Truncate Qs

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
> also send the HELP command for other information (like subscribing).
-- 
Author: Scott Shafer
  INET: scott.shafer_at_ildmail.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).

------_=_NextPart_001_01BFDB98.0C0892D0
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>RE: Truncate Qs</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Cascade constraints option does not exist in truncate.</FONT>
</P>

<P><FONT SIZE=2>Alex Hillman</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Scott Shafer [<A HREF="mailto:scott.shafer_at_ildmail.com">mailto:scott.shafer_at_ildmail.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Tuesday, June 20, 2000 5:58 PM</FONT>
<BR><FONT SIZE=2>To: Multiple recipients of list ORACLE-L</FONT>
<BR><FONT SIZE=2>Subject: Re: Truncate Qs</FONT>
</P>
<BR>

<P><FONT SIZE=2>because constraints exist independent of data.&nbsp; If there are any foreign key</FONT>
<BR><FONT SIZE=2>relationships, you need to use &quot;cascade constraints&quot; which tells the db to</FONT>
<BR><FONT SIZE=2>ignore any key info...</FONT>
</P>

<P><FONT SIZE=2>--Scott</FONT>
</P>

<P><FONT SIZE=2>----- Original Message -----</FONT>
<BR><FONT SIZE=2>To: &quot;Multiple recipients of list ORACLE-L&quot; &lt;ORACLE-L_at_fatcity.com&gt;</FONT>
<BR><FONT SIZE=2>Sent: Tuesday, June 20, 2000 4:19 PM</FONT>
</P>
<BR>

<P><FONT SIZE=2>&gt; Thanks Scott,</FONT>
<BR><FONT SIZE=2>&gt; I was just wondering if there is no data in the table, then also why</FONT>
<BR><FONT SIZE=2>should</FONT>
<BR><FONT SIZE=2>&gt; truncate table give the error.</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; To: &lt;willsm_at_hotmail.com&gt;</FONT>
<BR><FONT SIZE=2>&gt; Date: Tue, 20 Jun 2000 14:40:33 -0500</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; truncate table &lt;tabname&gt; cascade constraints;</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; ----- Original Message -----</FONT>
<BR><FONT SIZE=2>&gt; To: &quot;Multiple recipients of list ORACLE-L&quot; &lt;ORACLE-L_at_fatcity.com&gt;</FONT>
<BR><FONT SIZE=2>&gt; Sent: Tuesday, June 20, 2000 3:12 PM</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; Hello,</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; Can someone please explain me this:</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; I tried to truncate a table, it gave ORA-2266.</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; But when I deleted the rows, it did not show the error. And after</FONT>
<BR><FONT SIZE=2>&gt; deleting</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; the rown I tried to truncate the table again, but it still gives</FONT>
<BR><FONT SIZE=2>ORA-2266</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; TIA</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; Prabal</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; SQL&gt; truncate table supplier_order;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; truncate table supplier_order</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; ERROR at line 1:</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; ORA-02266: unique/primary keys in table referenced by enabled foreign</FONT>
<BR><FONT SIZE=2>&gt; keys</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; SQL&gt; delete supplier_order;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; 97 rows deleted.</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; SQL&gt; truncate table supplier_order;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; truncate table supplier_order</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; ERROR at line 1:</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; ORA-02266: unique/primary keys in table referenced by enabled foreign</FONT>
<BR><FONT SIZE=2>&gt; keys</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;</FONT>
<BR><FONT SIZE=2>________________________________________________________________________</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; Get Your Private, Free E-mail from MSN Hotmail at</FONT>
<BR><FONT SIZE=2>http://www.hotmail.com</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; --</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; Author: Prabal Biswas</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;&nbsp;&nbsp; INET: willsm_at_hotmail.com</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) 538-5051&nbsp; FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; San Diego, California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet access / Mailing Lists</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; --------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; To REMOVE yourself from this mailing list, send an E-Mail message</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; the message BODY, include a line containing: UNSUB ORACLE-L</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; (or the name of mailing list you want to be removed from).&nbsp; You may</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; &gt; also send the HELP command for other information (like subscribing).</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; ________________________________________________________________________</FONT>
<BR><FONT SIZE=2>&gt; Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; --</FONT>
<BR><FONT SIZE=2>&gt; Author: Prabal Biswas</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp; INET: willsm_at_hotmail.com</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) 538-5051&nbsp; FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=2>&gt; San Diego, California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet access / Mailing Lists</FONT>
<BR><FONT SIZE=2>&gt; --------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>&gt; To REMOVE yourself from this mailing list, send an E-Mail message</FONT>
<BR><FONT SIZE=2>&gt; to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in</FONT>
<BR><FONT SIZE=2>&gt; the message BODY, include a line containing: UNSUB ORACLE-L</FONT>
<BR><FONT SIZE=2>&gt; (or the name of mailing list you want to be removed from).&nbsp; You may</FONT>
<BR><FONT SIZE=2>&gt; also send the HELP command for other information (like subscribing).</FONT>
</P>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Author: Scott Shafer</FONT>
<BR><FONT SIZE=2>&nbsp; INET: scott.shafer_at_ildmail.com</FONT>
</P>

<P><FONT SIZE=2>Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) 538-5051&nbsp; FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=2>San Diego, California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet access / Mailing Lists</FONT>
<BR><FONT SIZE=2>--------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>To REMOVE yourself from this mailing list, send an E-Mail message</FONT>
<BR><FONT SIZE=2>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in</FONT>
<BR><FONT SIZE=2>the message BODY, include a line containing: UNSUB ORACLE-L</FONT>
<BR><FONT SIZE=2>(or the name of mailing list you want to be removed from).&nbsp; You may</FONT>
Received on Wed Jun 21 2000 - 10:47:47 CDT

Original text of this message

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