I am failing to truncate (or populate later on) a table in a MySQL database using DBI.
my $table = 'modeltargetsHet'; my $sth = $dbh->prepare(q{ truncate ?; }) or die $dbh->errstr; $sth->execute($table) or die $dbh->errstr;
produces this error:
DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''modeltargetsHet'' at line 1 at identifyModeltargets.pl line 204.How do I have to pass the table name correctly?
Manual executing the truncate command works fine.
In reply to DBI passing tablename by RobertCraven
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |