I find it a bit confusing because when you create
a PRIMARY KEY AUTOINCREMENT then a
table named sqlite_sequence is created.

According to the SQL (2003) standard multiple sessions are
guaranteed to allocate distinct sequence values.
(even when rollbacks are involved)


2014-11-11 11:14 GMT+01:00 Andy Ling <andy.l...@quantel.com>:

> > --- Begin ---
> >
> > sqlite> drop table if exists demo;
> > sqlite> create table demo (id integer primary key autoincrement, value
> > text);
> > sqlite> begin transaction;
> > sqlite> insert into demo (value) VALUES ('value');
> > sqlite> select last_insert_rowid();
> > 1
> > sqlite> delete from demo where id = 1;
> > sqlite> rollback;
> > sqlite> begin transaction;
> > sqlite> insert into demo (value) VALUES ('value');
> > sqlite> select last_insert_rowid();
> > 1
> >
> > --- End ---
> >
> > Using a delete statement before the rollback
> > doesn't help.
> >
> > I really want sqlite to only issue an id once.
> >
>
> Surely the whole point of rollback is that it puts the database back to the
> state it was in before the transaction started. So everything should be
> just as if no inserts (or deletes or anything else)had happened, including
> any changes to autoincrement values.
>
> Regards
>
> Andy Ling
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Koen Van Exem
+32 3301 3301
+32 498 519999
k...@allors.com
http://www.allors.com
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to