How do i drop multiple tables
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


How do i drop multiple tables Expand / Collapse
Author
Message
Posted 2/22/2007 5:08:19 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/23/2007 12:39:00 PM
Posts: 1, Visits: 1
I am new to the treadata environment, and would like to delete tables in my work environment (temporary work space)
For example
drop table s_mrktng.cletang_1486386770;
drop table s_mrktng.cletang_1486409292;
drop table s_mrktng.cletang_1486409363;
drop table s_mrktng.cletang_1486409456;
drop table s_mrktng.cletang_1486409527;

but instead of type the file name over and over can i do
drop table s_mrktng.cletang_1486* ;

If * is not the wild card is there one that i could use.

Thanks



Transforming Data into Insight
Post #6666
Posted 2/23/2007 12:46:11 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/12/2008 9:19:53 PM
Posts: 469, Visits: 463
There's a quick trick which DBAs normally use to generate all those drop statements.

SELECT 'DROP TABLE ' || TRIM(DATABASENAME) || '.' || TRIM(TABLENAME) || ';'
FROM DBC.TABLES
WHERE DATABASENAME='s_mrktng'
AND TABLEKIND = 'T'
AND TABLENAME LIKE 'cletang_1486%';

Then copy paste and run those outputs.

Of course some get further creative by writing scripts to export the above output via bteq and run it again from bteq and so on ...

but I think this is sufficient to serve your purpose.
Post #6669
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 4 ( 4 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 8:49pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.156. 10 queries. Compression Disabled.