drop schema problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ian Dobson

    drop schema problems

    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


  • Ian

    #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! =-----

    Comment

    Working...