The tcl interface spec says: 

> The "last_insert_rowid" method returns an integer which is the ROWID of 
> the most recently inserted database row.  

So if I have 

db eval {CREATE TABLE t(the_key INTEGER PRIMARY KEY, data TEXT)}

and I

db eval {INSERT INTO t VALUES(NULL, 'foo')}

then does 

db last_insert_rowid

reliably return the_key of the most recently inserted database row, 
so that the returned value may safely (across vacuums etc) be used 
as a foreign reference to t's the_key column?

Is this the best way of inserting a guaranteed non-conflicting row &
getting the new row's key?

-- 
Eric A. Smith

Money is the root of all wealth.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to