私のために働く
$ perl -E'
use DBI;
my $dbh = DBI->connect("dbi:SQLite:", undef, undef,
{ PrintError => 0, RaiseError => 1, AutoCommit => 1 });
$dbh->do("CREATE TEMP TABLE MyTable ( id INT )");
$dbh->do("INSERT INTO MyTable VALUES (?)", undef, $_) for 1..9;
my $sql = "SELECT * FROM MyTable LIMIT 3 OFFSET 4";
my $sth = $dbh->prepare($sql);
$sth->execute();
say for keys %{ $sth->fetchall_hashref("id") };
'
5
6
7
またはコマンド ライン クライアントから
$ sqlite3
SQLite version 3.3.6
Enter ".help" for instructions
sqlite> CREATE TEMP TABLE MyTable ( id INT );
sqlite> INSERT INTO MyTable VALUES (1);
sqlite> INSERT INTO MyTable VALUES (2);
sqlite> INSERT INTO MyTable VALUES (3);
sqlite> INSERT INTO MyTable VALUES (4);
sqlite> INSERT INTO MyTable VALUES (5);
sqlite> INSERT INTO MyTable VALUES (6);
sqlite> INSERT INTO MyTable VALUES (7);
sqlite> INSERT INTO MyTable VALUES (8);
sqlite> INSERT INTO MyTable VALUES (9);
sqlite> SELECT * FROM MyTable LIMIT 3 OFFSET 4;
5
6
7
sqlite> .q
バージョン:
$ perl -MDBI -E'
my $dbh = DBI->connect("dbi:SQLite:", undef, undef);
say for
$DBD::SQLite::VERSION,
$dbh->{sqlite_version}
'
1.40
3.7.17