in reply to seeking barebones sqlite example with transaction
Don't put the BEGIN/COMMIT in your sql, and don't use compound queries. See the AutoCommit attribute, and the commit() method in DBI. Basically, turn AutoCommit off (upon connect() or afterwards), execute your inserts (or other statements) one statement at a time then call commit() or rollback() to commit or rollback your transactions. With AutoCommit off, a new transaction is automatically started after every commit or rollback (and after turning it off).
On another note, you may also want to check out What are placeholders in DBI, and why would I want to use them?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: seeking barebones sqlite example with transaction
by bart (Canon) on Aug 05, 2006 at 00:06 UTC | |
|
Re^2: seeking barebones sqlite example with transaction
by dimar (Curate) on Aug 05, 2006 at 14:30 UTC |