On 2010-11-29, tinauser <tinau...@libero.it> wrote:
> '''
> INSERT INTO 'foo' VALUES (?,?)
> '''
> ,('NULL','yyy'))

s/'NULL'/None/

> I get a datatype mismatch error.

The sqlite module is smart enough to convert between Python types and
Sqlite types.  If you pass it 'NULL' it thinks you are passing it a string.
Python uses None in much the same way that databases use NULL, so the
module converts None to 'NULL' and vise versa.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to