[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: lsqlite3, no way to bind null?
- From: HyperHacker <hyperhacker@...>
- Date: Thu, 10 Nov 2011 01:40:16 -0700
I'm using lsqlite3 with prepared statements like (simplified example):
local stmt = db:prepare("INSERT INTO items (x, y, z) VALUES (?, ?, ?)")
stmt:bind_values(a, b, c)
The problem is if, for example, a is nil and x is a numeric, nullable
type such as INTEGER, x ends up being not null but zero. Seemingly the
only way to actually insert null is to explicitly specify it in the
query, instead of as a parameter, which kinda defeats the purpose of
parameters. Is there some workaround?
Sent from my toaster.