我想在某个时间的Perl下SQLite数据库上做VACUUM
,但它总是说
DBD :: SQLite的:: DB做失败:不能从一个事务中真空
那么,我该如何做到这一点?
my %attr = (RaiseError => 0, PrintError => 1, AutoCommit => 0);
my $dbh = DBI->connect('dbi:SQLite:dbname='.$file'','',\%attr)
or die $DBI::errstr;
我正在使用AutoCommit => 0
。并且错误发生时:
$dbh->do('DELETE FROM soap');
$dbh->do('DELETE FROM result');
$dbh->commit;
$dbh->do('VACUUM');