Michael Roth wrote:
I create a prepared statement with this:
local db = sqlite3.open("somefilename")
local stmt_a = db:prepare("SELECT * FROM test WHERE id=?1")
local stmt_b = db:prepare("XYZ ?1 XYZ ?2 XYZ ?1")
local id = 123
local str = "Hello World"
stmt_a:bind(id)
stmt_a:bind(id, str)
The point is, inside stmt:bind() (which does type conversion and so on)
there is no way to access the variable names used to call stmt:bind().
You could always call bind like this:
stmt_a:bind{ id = 1, name = "John", age = 15 }
and then iterate through the table and bind all the values in the table.
-Tiago