[Tutor] cant autoincrement

bob gailer bgailer at gmail.com
Fri Apr 26 19:10:34 CEST 2013


On 4/26/2013 8:45 AM, Lolo Lolo wrote:
> I'm doing a test database with sqlite and have run into some problems. 
> in my 1st table i have an id field:
> id INTERGER Primary Key
> ... when i insert into it, i leave the id field empty
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 suggest you join 
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users - as this 
is the preferred place to ask sqlite questions.

-- 
Bob Gailer
919-636-4239
Chapel Hill NC

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130426/1eef21ea/attachment.html>


More information about the Tutor mailing list