Conversion from None to NULL not working?

  • crys

    crys - 2010-09-07


    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?



  • crys

    crys - 2010-09-07

    Sorry, please forget what I just wrote. Sorry for the uproar.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks