Silly/crazy problem with sqlite

Sibylle Koczian nulla.epistola at web.de
Sat Nov 25 08:34:37 EST 2023


Am 24.11.2023 um 22:49 schrieb Rimu Atkinson via Python-list:
> 
>>
> 
>> I really can't think of a case
>> where the missing comma would make any sense at all.
>>
> 
> That is pretty tricky, yes.
> 
> The comma means it's a tuple. Without the comma, it's just a string with 
> parenthesis around it, which is a string.
> 

Placeholders for the parameters in an SQL command for 
sqlite3.execute(..) must always be given as dict or sequence. Even if 
it's just one parameter.

Same thing with other database modules, it's given in PEP 249.

HTH
Sibylle



More information about the Python-list mailing list