Help: Omitting quotes from SQL Queries.
daniel at dittmar.net
Wed Jan 8 13:28:07 CET 2003
> Could you give me a little more detail about the
> execute ("SELECT ...",[fileName]) appraoch as I am not familiar with
> the syntax.
for fileName in fileNameList:
cursor.execute("""SELECT fileSize FROM database where
database.filename = ?""", [fileName])
fileSizes = cursor.fetchall()
The driver is responsible for replacing the ? with the actual value.
Python drivers differ in the kind of placeholders they accept, but
mxODBC should work fine with the question mark.
More information about the Python-list