sqlite autoincrement of primary key

Mel mwilson at the-wire.com
Mon Nov 29 19:19:19 CET 2010


tinauser wrote:

> Normally, the sqlite command that works would be
> 
> INSERT INTO 'foo' VALUES (NULL, 'yyy' )
> 
> however, if in python i try to execute a script like:
> 
> cur.execute(
> '''
> INSERT INTO 'foo' VALUES (?,?)
> '''
> ,('NULL','yyy'))
> 
> I get a datatype mismatch error.
> 
> Has anyone a workaround ?

Have you tried 

'''INSERT INTO foo VALUES (NULL, ?)'''

	Mel.




More information about the Python-list mailing list