By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,657 Members | 862 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,657 IT Pros & Developers. It's quick & easy.

drop schema problems

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ian
Ian Dobson wrote:
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?


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! =-----
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.