Re: [sqlite] Setting where AUTOINCREMENT starts?
Shawn Wilsher <[EMAIL PROTECTED]> wrote: > I was wondering if we could set the value that an AUTOINCREMENT starts > at for temporary tables. Right now we are looking at having to manage > it ourselves, but if we could use sqlite to handle it, as long as it > starts at the right value, that would be ideal. http://sqlite.org/autoinc.html Read about SQLITE_SEQUENCE table. Simply update the starting count there before inserting any rows. Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Setting where AUTOINCREMENT starts?
Looks like you can insert and delete a row to set whatever you want as the starting number: sqlite> create table t1 (oid integer primary key autoincrement, a); sqlite> insert into t1 values (100, 'foo'); sqlite> delete from t1; sqlite> insert into t1 (a) values ('bar'); sqlite> select * from t1; 101|bar -Clark - Original Message From: Shawn Wilsher <[EMAIL PROTECTED]> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Monday, June 30, 2008 2:55:34 PM Subject: [sqlite] Setting where AUTOINCREMENT starts? Hey all, I was wondering if we could set the value that an AUTOINCREMENT starts at for temporary tables. Right now we are looking at having to manage it ourselves, but if we could use sqlite to handle it, as long as it starts at the right value, that would be ideal. Cheers, Shawn ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Setting where AUTOINCREMENT starts?
Hey all, I was wondering if we could set the value that an AUTOINCREMENT starts at for temporary tables. Right now we are looking at having to manage it ourselves, but if we could use sqlite to handle it, as long as it starts at the right value, that would be ideal. Cheers, Shawn ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users