in reply to Re: SQL with DBI
in thread SQL with DBI

Extending on what neniro and CZ have said-

you can also do something like this

 my $tables = join (',',@tables_to_drop;)

and use it in the drop statement  $dbh->do("DROP TABLE $tables;") or die dbh->errstr;

I am assuming your SQL engine allows multiple table drops when they separated by commas. It works for me in MySQL

Also note that using the $variable inside the query is sometimes considered to be dangerous esp if it is a user input. http://www.perl.com/pub/a/1999/10/DBI.html

cheers

SK

Replies are listed 'Best First'.
Re^3: SQL with DBI
by VSarkiss (Monsignor) on Jun 27, 2005 at 15:30 UTC