lua-users home
lua-l archive

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



 Hi
 
Yes agreed,  this was a cut down simplified version of my original problem.
 
That nil value was the column where the blob is and it will get overwritten by the bind_blob line below it, consequently it makes no difference, that value can by anything you like.
 
The general structure of how I have done the binding is the fundamental problem.
 
I hate bits of code that dont look right to me but irritatingly work OK Open-mouth smile
 
Geoff
 
 
> From: k0mpjut0r@gmail.com
> Date: Sun, 11 Mar 2012 12:49:03 +0100
> To: lua-l@lists.lua.org
> Subject: Re: Need some assistance with snippet of Lua/Sqlite code
>
> On 11 March 2012 12:06, Jeff Smith <spammealot1@live.co.uk> wrote:
> >    stmt = db:prepare[[ INSERT INTO tblApplications (AppFileName, AppBlob,
> > GeneralNotes) VALUES( ?, ?, ?)]];
> >    stmt:bind_values( someAppName, NULL, someGenNotes)
> >    stmt:bind_blob(2, blobStr)
>
> Not directly answering your question, but since you do not define
> "NULL" anywhere, it is considered a global variable, and it's value is
> "nil" in Lua. So this would be equivalent:
>
> stmt:bind_values(someAppName, nil, someGenNotes)
>