John Elrick wrote:
> Angus March 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".
>>   
>>     
>
> The page (http://sqlite.org/c3ref/bind_blob.html) reads:
>
> "In the SQL strings input to sqlite3_prepare_v2() and its variants, 
> literals may be replaced by a parameter in one of these forms:
>
>     * ?
>     * ?NNN
>     * :VVV
>     * @VVV
>     * $VVV "
>
> The documentation for NNN is three sentences below this and states that 
> the NNN refers to a number such as:
>
> ?1 ?2
>   

    I don't see that anywhere on the page. An example might have made a
difference.

> I'm also unsure why you've added single and double quotes.  Maybe:
>
> UPDATE KEYS SET IVAndKey=? WHERE ItemID = ?
>   

    Well, I was using single quotes before, and it didn't like them in
things like the WHERE clause and SELECT clause, so I changed those ones
to double quotes.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to