Skip to content
Advertisement

Sqlite3 – Update table using Python code – syntax error near %s

This is my Python code –

This is the SQL statement I try in SQLite3 manager (Firefox extension)

The error I get is –

I have tried many web searches including SO, tutorials and self-troubleshooting, but this error does not go away. What exactly I am doing wrong here.

Advertisement

Answer

I believe Python’s SQLite implementation uses ? placeholders, unlike MySQLdb’s %s. Review the documentation.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement