in reply to SQLite segmentation fault in DBI?

The following works for me:
use strict; use warnings; use DBI; my $dbh = DBI->connect( "dbi:SQLite:dbname=test.sqlite", "", "", { Rai +seError => 1 } ); $dbh->do("CREATE TABLE aaa (num INTEGER, name TEXT)"); $dbh->do("CREATE TABLE bbb (num INTEGER, name TEXT)"); my $i = 1; for (qw(alice bob carol)) { $dbh->do( "INSERT INTO aaa VALUES (?, ?)", {}, $i++, $_ ); } my $sth = $dbh->prepare("SELECT * FROM aaa"); $sth->execute; while ( my @row = $sth->fetchrow_array ) { $dbh->do( "INSERT INTO bbb VALUES (?, ?)", {}, @row ); }
Perhaps you should post the code that reproduces the problem

Replies are listed 'Best First'.
Re^2: SQLite segmentation fault in DBI?
by mje (Curate) on Jan 26, 2010 at 13:07 UTC

    and although it may work and is only an example it is also a prime example of doing something in Perl that could be better done in the database - insert into bbb (num, name) select num, name from aaa. I sincerely hope the OP is not doing something like this.