On Jan 18, 2012, at 4:16 PM, g...@novadsp.com wrote:

>> 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.
> 
> *Splendid* idea, one for the FAQ surely.

Yes, this is a pretty common idiom. 

> Presumably this can be used in a binding string as in this?
> 
> "INSERT INTO gps_index (auto_id,minX, maxX,minY, maxY) 
> VALUES(last_insert_rowid(), ?, ?, ?, ?)"

Yes, exactly.

> Thank you :)

You are welcome.

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

Reply via email to