[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Simple PostgreSQL client library
- From: eugeny gladkih <john@...>
- Date: Mon, 02 Apr 2007 11:32:57 +0400
>>>>> "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