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/DELETE/CONSTRAINTS/HELP

Re: TRUNCATE/DELETE/CONSTRAINTS/HELP

From: Pratap Singh <singhp_at_BACTC.COM>
Date: Thu, 11 Jan 1996 08:09:44 PST
Message-Id: <9601111616.AA05269@alice.jcc.com>


At 05:12 PM 1/9/96 -0500, you wrote:
>When attempting to delete/truncate all data from a schema's tables,
>I get errors due to referential constraints. I seem to remember a
>way to delete/truncate the tables in the proper order without having
>to create a scripts truncating/deleting the tables in any particular
>order.... something like a schema keyword? Does anyone know what I'm
>talking about? As it stands now, we have to disable the constraints
>before we can use the truncate.
>
>Thanks.
>
>
>|===========================================================|
>| Robert Sisk Phone: (803) 935-8136 |
>| SCT Utility Systems Email: rsisk_at_sctcorp.com |
>|===========================================================|
>

Hi

There is a cascade option in constraint itself. refer SQL language reference manual (4-122 to 4-136) on page 4-129 you will find about delete cascade. This will allow deletion of referenced key value in parent table having dependent rows in child table. In this case oracle will automatically delete dependent rows from child table.

I hope this helps.



Pratap Singh

Email: singhp_at_bactc.com
Voice: 415-827-5868
Fax: 415-266-6324



We are free to choose what we will do, think, say, be, but we are not free to choose the consequences of those choices.
Received on Thu Jan 11 1996 - 11:16:59 CST

Original text of this message

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