I installed DBI 1.50 and tried a simple example:
| Posted on 2006-03-30 19:09:09-08 by nadejda |
| DBI::SQLite error |
|
I installed DBI 1.50 and tried a simple example:
#!/usr/bin/perl -w
use strict;
use DBI;
my $dbh = DBI->connect('dbi:SQLite:dbname=lj.db') or die $DBI::errstr;
$dbh->selectrow_arrayref("SELECT * from user")
or die $dbh->errstr;
$dbh->disconnect;
and that's what I got:
DBD::SQLite::db selectrow_arrayref failed: not an error(21) at dbdimp.c line 398 at test_db.pl line
+ 7.
not an error(21) at dbdimp.c line 398 at test_db.pl line 7.
With trace(4):
DBI::db=HASH(0x82ad764) trace level set to 0x0/4 (DBI @ 0x0/0) in DBI 1.50-ithread (pid 32329)
-> selectrow_arrayref for DBD::SQLite::db (DBI::db=HASH(0x82ad404)~0x82ad764 'SELECT * from use
+r') thr#8150008
1 -> prepare for DBD::SQLite::db (DBI::db=HASH(0x82ad764)~INNER 'SELECT * from user' undef) thr#8
+150008
dbih_setup_handle(DBI::st=HASH(0x82ad878)=>DBI::st=HASH(0x82ad9c8), DBD::SQLite::st, 82ad884, N
+ull!)
dbih_make_com(DBI::db=HASH(0x82ad764), 82afc80, DBD::SQLite::st, 124, 0) thr#8150008
sqlite trace: prepare statement: SELECT * from user at dbdimp.c line 258
1 <- prepare= DBI::st=HASH(0x82ad878) at test_db.pl line 7
sqlite trace: Execute returned 0 cols
at dbdimp.c line 391
sqlite error 21 recorded: not an error at dbdimp.c line 398
!! ERROR: 21 'not an error(21) at dbdimp.c line 398' (err#0)
<- selectrow_arrayref= undef at test_db.pl line 7
DBD::SQLite::db selectrow_arrayref failed: not an error(21) at dbdimp.c line 398 at test_db.pl line
+ 7.
-> errstr in DBD::_::common for DBD::SQLite::db (DBI::db=HASH(0x82ad404)~0x82ad764) thr#8150008
ERROR: 21 'not an error(21) at dbdimp.c line 398' (err#0)
<- errstr= ( 'not an error(21) at dbdimp.c line 398' ) [1 items] at test_db.pl line 7
not an error(21) at dbdimp.c line 398 at test_db.pl line 7.
-> DESTROY for DBD::SQLite::st (DBI::st=HASH(0x82ad9c8)~INNER) thr#8150008
ERROR: 21 'not an error(21) at dbdimp.c line 398' (err#0)
<- DESTROY= undef
-> DESTROY for DBD::SQLite::db (DBI::db=HASH(0x82ad764)~INNER) thr#8150008
ERROR: 21 'not an error(21) at dbdimp.c line 398' (err#0)
<- DESTROY= undef
I use Perl for Linux 2.6.15. Does anybody know how to fix this?
|
| Direct Responses: 2088 | Write a response |