Hi,
it seems I'm havong problems with a executemany() call when None values are involved. The statement looks like this:
cursor.executemany(""" INSERT INTO table VALUES (%s,%s,%s,%s,%s) """, tuples)
The last column in table is of float type. In case a tuple-entry contains a 'None', a mysql warning is raised like
Warning: Data truncated for column 'rmsd_calpha' at row 1
Then, the value 0 is inserted instead of a NULL.
If I do a simple execute() with a None value involved, the conversion to a MySQL NULL works fine.
Am I doing something wrong here? Or is this a bug?
Thanks,
Chris
Sorry, please forget what I just wrote. Sorry for the uproar.
Log in to post a comment.
Hi,
it seems I'm havong problems with a executemany() call when None values are
involved. The statement looks like this:
cursor.executemany(""" INSERT INTO table VALUES (%s,%s,%s,%s,%s) """, tuples)
The last column in table is of float type. In case a tuple-entry contains a
'None', a mysql warning is raised like
Warning: Data truncated for column 'rmsd_calpha' at row 1
Then, the value 0 is inserted instead of a NULL.
If I do a simple execute() with a None value involved, the conversion to a
MySQL NULL works fine.
Am I doing something wrong here? Or is this a bug?
Thanks,
Chris
Sorry, please forget what I just wrote. Sorry for the uproar.