Re: [sqlite] last_insert_rowid() question

2010-12-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/27/2010 11:41 AM, Scott A Mintz wrote: > I know that I can use sqlite3_last_insert_rowid() to retrieve the value. > However, in a multi-threaded environment, it's possible for another thread > to do an INSERT before I get the first result. Wha

Re: [sqlite] last_insert_rowid() question

2010-12-27 Thread Drake Wilson
Quoth Scott A Mintz , on 2010-12-27 14:41:23 -0500: > I know that I can use sqlite3_last_insert_rowid() to retrieve the value. > However, in a multi-threaded environment, it's possible for another thread > to do an INSERT before I get the first result. That'll only affect the last_insert_rowid i

Re: [sqlite] last_insert_rowid() question

2010-12-27 Thread Igor Tandetnik
Scott A Mintz wrote: > If I have a table with an INTEGER PRIMARY KEY column, and I INSERT a new > row into the table with a NULL binding to that column, sqlite will > generate a unique value for me. > > I know that I can use sqlite3_last_insert_rowid() to retrieve the value. > However, in a multi

Re: [sqlite] last_insert_rowid() question

2010-12-27 Thread Simon Slavin
On 27 Dec 2010, at 7:41pm, Scott A Mintz wrote: > I know that I can use sqlite3_last_insert_rowid() to retrieve the value. > However, in a multi-threaded environment, it's possible for another thread > to do an INSERT before I get the first result. What's the best way to > retrieve the rowid?

[sqlite] last_insert_rowid() question

2010-12-27 Thread Scott A Mintz
If I have a table with an INTEGER PRIMARY KEY column, and I INSERT a new row into the table with a NULL binding to that column, sqlite will generate a unique value for me. I know that I can use sqlite3_last_insert_rowid() to retrieve the value. However, in a multi-threaded environment, it's po