lua-users home
lua-l archive

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


>>>>> "MB" == Michael Broughton <mbobowik@telusplanet.net> writes:

 MB> Anyway, here is an example of a basic query using my library:

 MB> local stmt = conn:statement"SELECT a, b, c FROM t WHERE d > $1 AND e = $2"
 MB> stmt:setInteger(1, 1234)
 MB> stmt:setString(2, "abcd")
 MB> local rs, count = stmt:selectResultSet()

what about more flexible idea - using separate statement and
bindings?

local stmt = conn:statement( "SELECT a, b, c FROM t WHERE d > $d AND e = $e" )
local rs, count = stmt:selectResultSet( { d=1; e="abc" } )

-- 
Yours sincerely, Eugeny.
Doctor Web, Ltd. http://www.drweb.com