From: ashbb Date: 2012-04-28T17:00:44+09:00 Subject: Re: ruby/shoes GUI - sqlite, how to isert a variable key in table? --e89a8ffba9551ce8e104beb89eb0 Content-Type: text/plain; charset=ISO-8859-1 Hi Danilo, Try out the following again. require 'sqlite3' Shoes.app do @name = "Danilo" db = SQLite3::Database.new "test.db" db.execute "create table test (test VARCHAR(25))" db.execute "insert into test (test) values ('#{@name}')" rows = db.execute "select * from test" rows.each{|name| para "#{name}"} end ashbb --e89a8ffba9551ce8e104beb89eb0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Danilo,

Try out the following again.

require 'sqlite3&= #39;
Shoes.app do
=A0 @name =3D "Danilo"
=A0 db =3D SQLi= te3::Database.new "test.db"
=A0 db.execute "create table = test (test VARCHAR(25))"
=A0 db.execute "insert into test (test) values ('#{@name}')&qu= ot;
=A0 rows =3D db.execute "select * from test"
=A0 rows.e= ach{|name| para "#{name}"}
end

ashbb

--e89a8ffba9551ce8e104beb89eb0--