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

Home -> Community -> Usenet -> c.d.o.server -> Re: cascade constraints on drop table, also on delete or truncate?

Re: cascade constraints on drop table, also on delete or truncate?

From: Bob Fazio <rfazio_at_home.com.nospam>
Date: 2000/05/27
Message-ID: <j1TX4.211699$Tn4.1889662@news1.rdc2.pa.home.com>#1/1

Yes you have to disable constraints, and it isn't hard at all.

select 'alter table '||owner||'.'||table_name||' disable constriant '||constraint_name||';'
from dba_constraints where constraint_type='R' and owner='SCOTT'; -- change owner name.

--
Robert Fazio, Oracle DBA
rfazio_at_home.com
remove nospam from reply address
http://24.8.218.197/
"Naguib Younes" <ynaguib_at_videotron.ca> wrote in message
news:QvSX4.3257$p7.127356_at_wagner.videotron.net...

> Why don`t you try Exporting the structure of the database, droping all the
> tables a importing the structure again. That is the fastest way to do it,
> and the easiest.
>
> NY
> <orauser_at_my-deja.com> wrote in message news:8gnmb8$csn$1_at_nnrp1.deja.com...
> > I understand you can drop a table, with cascade constraints.
> >
> > Can you do this when deleting rows? How about when truncating
> > a table (ideal)?
> >
> > I am trying to figure out the fastest way to purge a schema of
> > all data, in order to reload it. We dont want to drop/recreate,
> > we would rather do a truncate of the tables. Are we going to have
> > to disable or delete the constraints first? If so that is hard to
> > do in a script because the names of the constraints are machine
> > generated on create time.
> >
> > Any ideas?
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
Received on Sat May 27 2000 - 00:00:00 CDT

Original text of this message

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