I'm trying to change the user_version
of an SQLite database via Python 2.6, and I've tried to do the following:
cur.execute( "PRAGMA user_version = ?" , (version,) )
It fails with the following error:
cur.execute( "PRAGMA user_version = ?" , (version,) )
sqlite3.OperationalError: near "?": syntax error
I've tried the named style of substitution (instead of question marks) but that also fails with the same error.
If I drop a number in there as part of the SQL string or using Python's string operations it all works fine, but I'd rather not do either of those.
So why isn't this working?
And how do I safety insert a number from a variable in to this call?