On Jan 18, 2012, at 3:44 PM, Igor Tandetnik wrote:

>>> "INSERT INTO table (columns) VALUES(?,?,?,?);
>>> SELECT last_insert_rowid() FROM table;"
>> 
>> These are really two statements, not one. Execute them one after the other 
>> and you will get the desired effect.
> 
> Or just call sqlite3_last_insert_rowid() API function directly, without going 
> through SELECT statement.

Or just use last_insert_rowid() directly in the next insert statement. That 
will reuse the rowid of the previous insert for the new one. And both row will 
end up with the same id, keeping your source table and its R*Tree index in 
synch.


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to