I write a script that inserts in DB directly with the python cursor object
cursor.execute("INSERT INTO info ([height], [weight],[type]) VALUES (%s,%s,%s)" % (height, manufacturerid, weight))
Sometimes I don't have a number for "weight" and it throws an error:
Incorrect syntax near ','. (102) (SQLExecDirectW)")
How you handle errors like this?