Commits

Olav Andreas Lindekleiv committed dd4ae5e

Handle numbers / strings / NULLs correctly.

Comments (0)

Files changed (1)

                 # Add non-numbers with quotes:
                 try:
                     int(value)
-                    query_row.append(str(value))
                 except ValueError:
-                    query_row.append('"%s"' % value)
+                    # Don't put NULL in quotes:
+                    if value != 'NULL':
+                        value = '"%s"' % value
+                query_row.append(str(value))
 
             # Add semicolon on last row:
             new_row = ', '.join(query_row)