Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Running
use DBI; my $dbh=DBI->connect("dbi:SQLite:dbname=climhy","","") or die 'arrgh'; my $ech = $dbh->selectall_arrayref('select * from site');
I get
"DBD::SQLite::db selectall_arrayref failed: unsupported file format(1) + at dbdimp.c "
The select command works fine in sqlite's CLI i.e.
sqlite> select * from site;
What file format does it support?
And why don't it like the one that sqlite created????

2006-02-07 Retitled by g0n, as per Monastery guidelines
Original title: 'unsupported file format?'

Replies are listed 'Best First'.
Re: 'unsupported file format' in DBD::SQLite
by holli (Abbot) on Feb 07, 2006 at 20:37 UTC
    I guess you are trying to access a SQLite Version 2 database file with the SQLite Version 3 module. Please try (and install DBD::SQLite2)
    my $dbh=DBI->connect("dbi:SQLite2:dbname=climhy","","") or die 'arrgh' +;
    and see how it goes.


    holli, /regexed monk/
      Thanks every one.
      I think I get it. Who would have guessed I'm on the cutting edge. I just set up SQLite today. I'm running SQLite version 3.2.7. Does this mean I have to wait for DBD::SQLite3?
      I guess I'll try and find an old verion of SQLite.
        The newer versions of the module use SQLite 3. According to the change file, and if I read that correctly, any module version >= 1.00 should do. I think DBD::SQlite 1.10 or 1.11 would be best, as these module versions use the same db engine version as yours.
Re: 'unsupported file format' in DBD::SQLite
by Fletch (Bishop) on Feb 07, 2006 at 20:37 UTC

    Possibly your DBD::SQLite was compiled against a different version of SQLite than the version your sqlite command was?