From: Justin Rudd Date: 2004-09-11T05:22:24+09:00 Subject: Re: [ANN] SQLite/Ruby 2.0.1 BETA > - when you have a statement that does inserts, you must call next on the > result set to really execute the statement: stmt.execute { |result| > result.next } # the statement is not executed if next is not called > It would be great to have it in the FAQ, as it took me some time to > understand why my inserts where not working. I did the following... require 'sqlite' db = SQLite::Database.new( 'test.db' ) db.execute( "create table test ( pkid INTEGER, name VARCHAR(15) )") db.execute( "insert into test (pkid, name) values (1, 'justin')") db.execute( "select * from test" ).each { |row| p row } db.execute( "drop table test" ) db.close() And the inserts worked without having to call result.next. Am I missing something? -- Justin Rudd http://seagecko.org/thoughts/