Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Remove all tables for user with one SQl statement?
"Jan Doggen" <j.doggen_at_BLOCKqsa.nl> wrote:
> My 'problem' is simple in that there are no keys or constraints at all ;-)
> Jan
No keys or constraints at all? Why not use Notepad to store this data?
What is the data, and what possible use can it be - note the acronym RDBMS - the "R" stands for relational.
Paul...
> "Thomas Kellerer" <WVIJEVPANEHT_at_spammotel.com> wrote in message
> news:40nifiF1ajnf2U1_at_individual.net...
> > On 19.12.2005 10:21 sybrandb_at_yahoo.com wrote:
> > > You can't.
> > > You can of course
> > > begin
> > > for tab in (select table_name from dba_tables where owner= 'UserName' )
> > > loop
> > > execute immediate 'drop table Username.'||tab.table_name||' cascade
> > > constraints';
> > > end loop;
> > > end;
> > > /
> > > But you would need to make sure there are no foreign keys or drop the
> > > tables in the right order.
> >
> > Hmm, this confuses me a bit.
> >
> > A "DROP TABLE xyz CASCADE CONSTRAINTS" will remove all constraints on
> > the table as well, including foreign keys.
> >
> > So the order shouldn't actually matter in that case, shouldn't it?
> >
> > Thomas
> >
> >
> > --
> > It's not a RootKit - it's a Sony
>
-- plinehan __at__ yahoo __dot__ __com__ XP Pro, SP 2, Oracle, 9.2.0.1.0 (Enterprise Ed.) Interbase 6.0.1.0; When asking database related questions, please give other posters some clues, like operating system, version of db being used and DDL. The exact text and/or number of error messages is useful (!= "it didn't work!"). Thanks. Furthermore, as a courtesy to those who spend time analysing and attempting to help, please do not top post.Received on Mon Dec 19 2005 - 12:01:54 CST