lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Fri, Sep 9, 2016 at 2:03 PM, Leinen, Rick <> wrote:

Also, I don’t see sqlite3.ROW listed at  Should I be looking elsewhere?



where the results of step are listed.


that shows ROW. It is sqlite3.ROW because you typically do


   sqlite3 = require 'lsqlite3'


so all the constants are in the sqlite3 table.



Thanks Doug,


I think I’m getting it.  In the code snippet:


local insert_stmt = db:prepare('SELECT * FROM numbers') -- WHERE num1=1')

x = insert_stmt:get_names()


if sqlite3.ROW == insert_stmt:step() then

    x = insert_stmt:get_values()



:get_names() works because the first iteration returns the column names.  :step() then iterates to the first row of values so now :get_values works.  Correct?