MySQL problem

wes weston wweston at
Fri Mar 18 17:22:37 CET 2005

Dennis Lee Bieber wrote:
> On Thu, 17 Mar 2005 16:45:57 GMT, wes weston <wweston at> declaimed
> the following in comp.lang.python:
>>str = "INSERT INTO produkt1 (MyNumber) VALUES(%d)" % (MyNumber)
> 	Think you meant "MyValue" for the second item... However...
> 	Try neither, the recommended method is to let the execute() do
> the formatting... That way /it/ can apply the needed quoting of
> arguments based upon the type of the data.
> cursor.execute("insert into produkt1 (MyNumber) values (%d)", (MyValue))

    Do you know if this has some efficiency advantage
or is it just an agreed upon custom.

More information about the Python-list mailing list