Sorry the precedent message was in french :-(

I encountered a weird error using DBD::SQLite.

This code works good :

use DBI;
$dbh= DBI->connect("dbi:SQLite:dbname=./backup.db")|| warn $!;
$dbh->{TraceLevel} = "3|SQL";
$req='delete from logs where date not in (select date from logs order
by date desc limit 50)';
$dbh->do($req);

but this code does not work with perl DBD::SQLite :

use DBI;
$dbh= DBI->connect("dbi:SQLite:dbname=./backup.db")|| warn $!;
$dbh->{TraceLevel} = "3|SQL";
$req='delete from logs where date not in (select date from logs order
by date desc limit (select nlpurge from settings))';
# of course nlpurge=50 in table settings
$dbh->do($req);

but the request works with sqlite3 interpreter as follows :

sqlite3 mydb.sqlite "delete from logs where date not in (select date
from logs order by date desc limit (select nlpurge from settings))"

Do you have any idea why this does not work ?


I use version 1.09

Thanks

Reply via email to