What is this about?
[agiron@useclwslpv132 06/17/16 03:31 PM dropbox]$ cat test3.rb
require "sqlite3"
# Open a database
db = SQLite3::Database.new "test.db"
# Create a database
rows = db.execute <<-SQL
create table numbers (
name varchar(30),
val int
);
SQL
# Execute a few inserts
{
"one" => 1,
"two" => 2,
}.each do |pair|
db.execute "insert into numbers values ( ?, ? )", pair
end
# Find a few rows
db.execute( "select * from numbers" ) do |row|
p row
end
[agiron@useclwslpv132 06/17/16 03:32 PM dropbox]$ ruby test3.rb
/usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.11/lib/sqlite3/statement.rb:108:in
`step': database is locked (SQLite3::BusyException)
from
/usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.11/lib/sqlite3/statement.rb:108:in
`block in each'
from
/usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.11/lib/sqlite3/statement.rb:107:in
`loop'
from
/usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.11/lib/sqlite3/statement.rb:107:in
`each'
from
/usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:158:in
`to_a'
from
/usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:158:in
`block in execute'
from
/usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:95:in
`prepare'
from
/usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:134:in
`execute'
from test3.rb:7:in `<main>'
[agiron@useclwslpv132 06/17/16 03:32 PM dropbox]$
--
You received this message because you are subscribed to the Google Groups
"sqlite3-ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.