From: Justin Rudd Date: 2004-09-11T05:29:45+09:00 Subject: Re: [ANN] SQLite/Ruby 2.0.1 BETA HA! Never fails. 2 minutes after I hit send I realize you are talking about Statement not Database. Doh! Ignore the man behind the curtain... On Sat, 11 Sep 2004 05:22:24 +0900, Justin Rudd wrote: > > - 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/ > > -- Justin Rudd http://seagecko.org/thoughts/