On Thursday, January 23, 2014 8:35:58 AM UTC+5:30, Tim Chase wrote: > On 2014-01-23 03:32, lgabiot wrote: > > >>>cursor = conn.execute("SELECT filename, filepath FROM files > > >>>WHERE > > max_level<(?)", threshold) > > that doesn't work (throw an exception)
> That last argument should be a tuple, so unless "threshold" > is a tuple, you would want to make it > sql = "SELECT ... WHERE max_level < ?" > cursor = conn.execute(sql, (threshold,)) Seeing this is becoming a faq I looked at the docs to see if the tuple second argument could do with some more emphasis I think it sure could; see http://docs.python.org/2/library/sqlite3.html#sqlite3.Cursor The builtin connection.execute is even less helpful -- https://mail.python.org/mailman/listinfo/python-list