MySQLdb integer question

Ansgar Wollnik wiseworld at web.de
Sun Oct 19 15:27:30 EDT 2003


Scenario:

# myvalues
(1L,'text')

# sql="INSERT INTO %s (%s) VALUES %s"% (db,",".join(myfields),myvalues)

This doesn't work, because the Integer-Value (1L) is not converted into 
a Integer (without 'L'), so the INSERT statement is:

INSERT INTO db (id, sometext) VALUES (1L,'text')
                                       ^^

:-(


What can I do?

Ansgar





More information about the Python-list mailing list