Re: How to drop all views or tables?

From: Albert L. Evans, IV <ae0i+_at_andrew.cmu.edu>
Date: 28 Oct 92 08:19:31 GMT
Message-ID: <Ievhana00WB7I9cGJn_at_andrew.cmu.edu>


I'm not sure what particular platform you're on, but the following SQL*Plus commands will create a script you can run to delete all the tables.

First, connect as the user whose tables you wish to drop. Then type in the following statement:

SELECT 'DROP TABLE '||tname||';' FROM TAB

Save this command in your buffer by pressing return twice to get back to the SQL> prompt. Then

SET HEADING OFF
SET PAGES <some number bigger than the number of tables your dropping> SPOOL <filename you want to use>

at this point you should run the statement. When all the table names have been selected, type SPOOL OFF. Then run the script just created by using _at_<filename>

The script might show some error messages because of some extraneous characters you might have caught using the spool command. You can edit the script using whatever system editor you have.

I'm fairly sure the table TAB and column TNAME are the correct ones you need. I've worked on both the PC and VAX platforms and this will work correctly on the PC. On the VAX I seem to recall a table called ACCESSIBLE_TABLES, but that may be specific to ORACLE Financials/Application Foundation.

Let me know if you have any problems.

Bert Evans Received on Wed Oct 28 1992 - 09:19:31 CET

Original text of this message