As CountZero described above it is easier to use a foreach-loop. You don't need a statement-handle to drop tables (see DBI for more details). And you can use the qw-quoting operator to quote the tables in your array. The code above is untested but should be okay.my @tables_to_drop = qw(Grab_Addr2 Grab_MCC1 Grab_MCC2); foreach my $table (@tables_to_drop) { $dbh->do("DROP TABLE $table;") or die $dbh->errstr(); }
In reply to Re: SQL with DBI
by neniro
in thread SQL with DBI
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |