Dennis Lee Bieber wrote:
On Thu, 17 Mar 2005 16:45:57 GMT, wes weston <[EMAIL PROTECTED]> declaimed
the following in comp.lang.python:


str = "INSERT INTO produkt1 (MyNumber) VALUES(%d)" % (MyNumber)
cursor.execute(str)


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))


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

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to