Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: create SQLite database problems

by Riales (Hermit)
on Mar 06, 2012 at 23:24 UTC ( #958182=note: print w/ replies, xml ) Need Help??

in reply to create SQLite database problems

This seems to work for me as well. Kind of a shot in the dark, but have you tried explicitly turning autocommit on or just explicitly calling commit at the end of everything?

While you're at it, maybe consider setting the RaiseError flag to true as never know, right? Something like:

$dbh = DBI->connect( $dsn, $username, $password, Autocommit => 1, RaiseError => 1, );

Comment on Re: create SQLite database problems
Download Code
Replies are listed 'Best First'.
Re^2: create SQLite database problems
by chilledham (Pilgrim) on Mar 06, 2012 at 23:40 UTC

    Just a minor point: Autocommit should be AutoCommit

    Good suggestion! Still worked in my environment (and setting AutoCommit => 0 then doing $dbh->rollback(); did indeed create an empty SQLite database).

    Also, DBI expects AutoCommit & RaiseError to be passed in a hash reference:

    $dbh = DBI->connect( $dsn, $username, $password, { AutoCommit => 1, RaiseError => 1} );

      Blah, that'll teach me to forgo checking documentation and rely on my memory for such things. Good catch!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://958182]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2015-11-27 00:30 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (710 votes), past polls