Home » SQL & PL/SQL » SQL & PL/SQL » ...wanted a SQL query
...wanted a SQL query [message #22969] Thu, 07 November 2002 14:44 Go to next message
raman
Messages: 66
Registered: February 2000
Member
A user sent me 350 junk tables in Excel(under one column, 350 rows) which are to be deleted from a schema, and I should need a query to do that.

All I know is, using the following query:

Select 'delete table 'table_name';' from user_tables where table_name in (350 tables - cut & paste from Excel);

My question is: how to put each table in single codes with commas in the above brackets, rather than manually doing?

I would really appreciate your help

-Raj
Re: ...wanted a SQL query [message #22970 is a reply to message #22969] Thu, 07 November 2002 15:38 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
On the row of the first table in the spreadsheet, put this formula in the column to the right of the table (if the table_name is in A1, put this in B1):

="'"&A1&"',"


and then copy the formula down. Then you can highlight the results in column B and paste into your SQL query. You'll have to remove the column from the last table result.
Previous Topic: variable in clausule where
Next Topic: cursors and all_tables
Goto Forum:
  


Current Time: Mon Apr 29 05:42:53 CDT 2024