I try to select entries from a table using parametrized queries. They don't return any results. The code is as follows:
var = str.capitalize(var)
selected = db.execute('select a, b, c from table1 where a=(?)', [var])
The var is always a three lowercase character string (e.g. 'xxx'), the 'a' column is of type TEXT in the database, and contains three uppercase character strings (e.g. 'XXX').
I tried also the dreadful:
selected = db.execute('select a, b, c from table1 where a="%s"' % str.capitalize(var)])
because I believed it was a problem with the execute method omitting quotation marks, but it didn't work either. The only thing that got me any results was:
selected = db.execute('select a, b, c from table1 where a="XXX"')
I am using Python 3.6.0 on Windows 10, someone here suggested it might be an issue, but their solution didn't work for me either.