MySQLdb Only Supports %s for Parameter Substitutions

July 3rd, 2005

For an unknown reason, or maybe no reason at all, the MySQLdb Python module only supports parameter substitution using %s. That means that regardless of the datatype you are passing in, you use %s. It’s dicussed further in this DB-SIG thread. (What the author of that post says makes a lot of sense, that is, the API should either support all of the format codes, or simply use a different paramstyle, like qmark.)

Comments are closed.