MySQL Insert

Carsten Haese carsten.haese at
Tue Jul 15 19:32:40 CEST 2008

maestroQC wrote:
>     cursor.execute("INSERT INTO es_accounts (dateCreated,
> accountNumber, description, openingBalance) VALUES (%s, %s, %s
> , %d)", (date, accountNumber, description, dec))
>   File "c:\python25\lib\site-packages\MySQLdb\", line 151,
> in execute
>     query = query % db.literal(args)
> TypeError: int argument required

The placeholder for query parameters in MySQLdb is always %s, regardless 
of the data type the actual value might have.


Carsten Haese

More information about the Python-list mailing list