There are a couple issues with this code that are unrelated to your specific problem, but important to resolve:
my $db_attr = {RaiseError => 1, PrintError => 1}; my $db_error = $DBI::errstr; $dbh = DBI->connect("dbi:SQLite:$name_db","","",$db_attr); if (defined($db_error) && $db_error ne " ") {
First, it looks like you're not checking for connect errors properly. What would you expect to see in $db_error after connect? Second, you're using RaiseError, and checking $DBI::errstr. That is why it's clear these issues are unrelated to your specific problem. You'd be getting an exceptions anyway. You should pick one error or exception mechanism and go with it, not both.
--Dave
In reply to Re: Can't query SQLite in a while loop
by armstd
in thread Can't query SQLite in a while loop
by josef
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |