Insert NULL into mySQL datetime

Jussi Piitulainen jpiitula at ling.helsinki.fi
Thu Dec 26 18:59:08 CET 2013


Dennis Lee Bieber writes:

> On Wed, 25 Dec 2013 17:20:35 -0800 (PST), rurpy at yahoo.com declaimed
> the following:
> 
> >  if a is None:
> >    cur.execute("Insert Into mytable(datefield) VALUES(NULL))", (,))
> 
> 	I'm pretty sure that MySQLdb, at least, does not require the 
> 			, (,)
> when there are no placeholders in the SQL statement. Might even

Isn't (,) invalid syntax in itself? At least I get the exception from
writing just (,) to Python 3.

The empty tuple is denoted ().



More information about the Python-list mailing list