max(rowid) + 1 before the insert is a good approximation for the left bound. But if you want to know the exact value you can remember max(rowid) + 1 before insert and execute this after insert:
select min(rowid) from table_name where rowid >= remembered_value It will be guaranteed to give you exact left bound for the insert in case if reading remembered_value and inserting is made in the same transaction. Pavel On Thu, Jan 7, 2010 at 8:02 AM, Max Vlasov <max.vla...@gmail.com> wrote: > On Thu, Jan 7, 2010 at 3:56 PM, Igor Tandetnik <itandet...@mvps.org> wrote: > >> Max Vlasov wrote: >> > I have a query "INSERT ... SELECT" and after it performed it I have to to >> >> If by autoincrement you mean a column actually declared with the >> AUTOINCREMENT keyword, then the next ID is stored in SQLITE_SEQUENCE table. >> For details, see http://www.sqlite.org/autoinc.html >> >> Igor Tandetnik >> >> > I thought that direct access to that table is not a good idea. If the format > of it is not documented it can change at any moment or at least in the next > major version increment (sqlite 4 for example). > _______________________________________________ > 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