[Tutor] cant autoincrement

Lolo Lolo losermeloser at yahoo.com
Fri Apr 26 21:28:46 CEST 2013


what does your insert statement look like? According to the documentation (http://www.sqlite.org/faq.html#q1):

 "whenever you insert a NULL into that column of the table, the NULL
    is automatically converted into (1 + the highest value)." 

The insert statement should look like:
 
"INSERT INTO t1 VALUES(NULL,123);

 i included the null, my results are: 
    
cursor.execute("INSERT into person VALUES(NULL, arg1, arg2)")
 
my result is:
 
(None, value1, value2) #the key being None :(
 
also thanks for the link
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130426/f5d99075/attachment.html>


More information about the Tutor mailing list