Re: [sqlite] SQLite last inserted id

2007-01-22 Thread Ian Frosst
My issue with that is I need the rowid of the existing row back. Insert or ignore doesn't seem to update the database's last_insert_rowid in the ignore case, from what I've seen. Insert or Replace almost does it, but it re-allocates the rowid, which breaks my referential integrity. Should the I

Re: [sqlite] SQLite last inserted id

2007-01-22 Thread Nicolas Williams
If you'd have a unique index on that column then you could just use "INSERT OR IGNORE ..." Nico -- - To unsubscribe, send email to [EMAIL PROTECTED] ---

Re: [sqlite] SQLite last inserted id

2007-01-22 Thread Ian Frosst
I would like to solicit ideas on this as well. An operation similar to insert or replace, but that doesn't allocate a new row ID on replace (just returns the old one through the last insert row ID.) Having to do the search operation, and if it fails do an insert (or vice versa) doesn't seem opti

RE: [sqlite] SQLite last inserted id

2007-01-22 Thread Brett Keating
Can you use the API call sqlite3_last_insert_rowid ? -Original Message- From: Weston Weems [mailto:[EMAIL PROTECTED] Sent: Monday, January 22, 2007 3:58 PM To: sqlite-users@sqlite.org Subject: [sqlite] SQLite last inserted id What I'd ultimately like to do, and what I used to do with a