From: "Danilo L." Date: 2012-04-28T16:08:46+09:00 Subject: Re: ruby/shoes GUI - sqlite, how to isert a variable key in table? Hassan Schroeder wrote in post #1058680: > On Fri, Apr 27, 2012 at 9:35 AM, Danilo L. wrote: > >>>> db.execute "insert into db.table (column-name) values (#{@ivar})" > >> I tried it but did not work = / > > 1) What does "did not work" mean?? > > Was there an error message? Did an incorrect value get inserted > into the DB? No value? > > 2) The solution would be obvious if you first tried the above insert > statement with a string literal rather than a variable... Sorry me for not explaining, I tried: require 'sqlite3' Shoes.app @name = "Danilo" db = SQLite3::Database.new "test.db" db.execute "create table test (test VARCHAR(25))" db.execute "insert into test (test) values (#{@name})" end Then create the table but will not enter the @ name is null. @Satoshi This works, but I want to enter what is typed in the text box. -- Posted via http://www.ruby-forum.com/.