Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: script to delete miltiple tables

Re: script to delete miltiple tables

From: Steve Long <steven.long_at_erols.com>
Date: Sun, 6 May 2001 20:59:33 -0400
Message-ID: <9d4s73$mn5$1@bob.news.rcn.net>

i assume that when you say "a single database" you are implying that all of the tables are in one schema. assume the first column, A, contains the table names. do the following.

  1. insert a column in front of A so A becomes B and the new column is A
  2. insert in every row of column A that has a corresponding table name in B the text string "drop table "
  3. insert in every row of column C that has a corresponding table name in B the text string ';'
  4. select columns A, B, and C and merge them into one column.
  5. save the spreadsheet as ascii text with the extension .SQL rather than .TXT
  6. now run the .SQL file as a SQL script in the database connected with a user id that has privileges to drop these tables.

VIOLA! you are done.

"Jeanneli" <jeanneli_at_aol.com> wrote in message news:20010506115531.25638.00000832_at_ng-mh1.aol.com...
> Hi,
>
> Need someone's help here. I have a speadsheet that have 300 table names. I
 want
> a SQL script to read the file and delete those tables in a single
 database.
>
> Any one has the similar codes, or at least point me to the right
 direction? I
> am new to oracle :(.
>
> Thanks so much.
> Jeanne
Received on Sun May 06 2001 - 19:59:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US