Re: [sqlite] last_insert_rowid & INTEGER PRIMARY KEY columns

2010-06-08 Thread Andy Gibbs
>> [...] 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? > > Yes. Actually there *is* a caveat, which is that if the

Re: [sqlite] last_insert_rowid & INTEGER PRIMARY KEY columns

2010-06-07 Thread Igor Tandetnik
Eric Smith wrote: > 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

[sqlite] last_insert_rowid & INTEGER PRIMARY KEY columns

2010-06-07 Thread Eric Smith
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