sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Ian Dobson's Avatar

drop schema problems


Question posted by: Ian Dobson (Guest) on November 12th, 2005 06:03 AM
Hi, I need to drop a schema from a database but it has 400 tables in it.

Is there an easy way to do it other than
drop table schema1.table1
drop table schema1.table2
etc.. to 400 and then
drop schema schema1?

thanks


1 Answer Posted
Ian's Avatar
Guest - n/a Posts
#2: Re: drop schema problems

Ian Dobson wrote:[color=blue]
> Hi, I need to drop a schema from a database but it has 400 tables in it.
>
> Is there an easy way to do it other than
> drop table schema1.table1
> drop table schema1.table2
> etc.. to 400 and then
> drop schema schema1?[/color]

Unfortunately, no (unless you can drop the tablespace(s) that have these
objects).

You can, however, write SQL to generate your drop statements:

select
'drop table ' || rtrim(tabschema) || '.' || tabname
from
syscat.tables
where
tabschema = 'SCHEMA1' and
type = 'T'



Good luck,




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
Not the answer you were looking for? Post your question . . .
196,846 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,846 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors