From: Michel Date: 2012-04-27T15:34:22+09:00 Subject: Re: ruby/shoes GUI - sqlite, how to isert a variable key in table? --=-Rdhq42QgnSVHeCpq+Q/n Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit > Hello, I am struggling to insert a variable into a table, for example: > > > @name = edit_line > > db = SQLite3::Database.new "test.db" > db.execute "create table teste (teste VARCHAR(25))" > db.execute "insert into teste (teste) values (@name)" > > > How can I add what has been written in edit line in table? > db.execute( "insert into teste values ( ?)", @name) > --=-Rdhq42QgnSVHeCpq+Q/n Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit
Hello, I am struggling to insert a variable into a table, for example:


@name = edit_line

db = SQLite3::Database.new "test.db"
db.execute "create table teste (teste VARCHAR(25))"
db.execute "insert into teste (teste) values (@name)"


How can I add what has been written in edit line in table?

db.execute( "insert into teste values ( ?)", @name)

--=-Rdhq42QgnSVHeCpq+Q/n--