in reply to Keeping Perl DBI Quiet
my @temp_tables = qw/foo bar bax quux/; my %tables = map { $_ => {} } @{$dbh->selectall_arrayref("show tables", {Columns => + {}})}; foreach (@temp_tables) { $dbh->do("drop table $_") if exists $tables{$_}; }
The usual caveats apply WRT being careful about not dropping tables at random, etc.
If you're not using MySQL, perhaps the RDBMS you are using has an equivalent.
HTH
|
---|