![]() |
|
go ahead... be a heretic | |
PerlMonks |
Re: DBI "drop table"by radiantmatrix (Parson) |
on Apr 15, 2008 at 18:25 UTC ( [id://680614]=note: print w/replies, xml ) | Need Help?? |
As others have said, placeholders are for data -- table names are not data. Kudos, though, for thinking about placeholders and the implication that you care about safety in DBI-based scripts! What you want in this case is quote_identifier to properly quote the table name, then inline that into a do:
This would be called as drop($dbh,'perl'); to drop a table named 'perl'.
<–radiant.matrix–>
Ramblings and references The Code that can be seen is not the true Code I haven't found a problem yet that can't be solved by a well-placed trebuchet
In Section
Seekers of Perl Wisdom
|
|