在Perl文件中更新mssql设置日期

时间:2016-03-30 18:42:13

标签: sql-server perl

我想在Perl文件中的mssql中设置日期。 这是我的代码:

my $date = strftime "%Y%m%d", localtime();         
my $sql = $dbh->prepare("update BlastDatabaseDim set Databasedate = ? DatabaseVersion = ? where DatabaseName = ?");
$sql->execute($date,$DatabaseVersion,$db_name); 

此代码有什么问题?

我收到了这个错误:

Can't Execute Command 'update BlastDatabaseDim set Databasedate = ? DatabaseVersion = ? where DatabaseName = ?'
Description : Incorrect syntax near 'DatabaseVersion'.

1 个答案:

答案 0 :(得分:0)

您似乎错过了

之间的逗号
Databasedate = ? DatabaseVersion = ?

应该是

Databasedate = ? ,DatabaseVersion = ?