Pavel Ivanov wrote:
>> UPDATE 'KEYS' SET 'IVAndKey'=:VVV WHERE "ItemID"=?NNN
>> Where IVAndKey is a BLOB and ItemID is an INTEGER and the primary key
>> for the table. I'm told that there is a syntax error near "NNN".
>>     
>
> You have actually used some number instead NNN and wrote it here just
> for abstract example, haven't you? If not then complain about wrong
> syntax is because of this.
> I'd suggest you to not mix in one query parameters preceded by '?' and
> by ':'. So if you rewrite your query like this:
> UPDATE 'KEYS' SET 'IVAndKey'=?1 WHERE "ItemID"=?2
> or like this
> UPDATE 'KEYS' SET 'IVAndKey'=:FirstParam WHERE "ItemID"=:SecondParam
> then it will not cause syntax error and your bindings will be correct.
>   

    Oh, I get it! No, those weren't abstract examples, that's what I
literally had there. I thought you used the literal ?NNN for INTEGER
afinity, and :VVV for strings. Like I said, the documentation is very
confusing. Even if it had italicized the VVV and the NNN I might have
twigged.
    Thanks.

>
> Pavel
>
> On Tue, Aug 25, 2009 at 9:31 AM, Angus March<an...@uducat.com> wrote:
>   
>> I'm trying to make a prepared statement and bind parameters to it, but
>> the documentation is very confusing. This is the statement I'm trying to
>> prepare:
>> UPDATE 'KEYS' SET 'IVAndKey'=:VVV WHERE "ItemID"=?NNN
>> Where IVAndKey is a BLOB and ItemID is an INTEGER and the primary key
>> for the table. I'm told that there is a syntax error near "NNN".
>>
>> Also, are the correct binding calls:
>> sqlite3_bind_int(m_insert, 2, idItem);
>> sqlite3_bind_blob(m_insert, 1, p, DATA_KEY_RECORD_LENGTH, FreeBlob);
>> ?
>>
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>>     
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to