Hi Trey, Even I was looking for something like this. But I don't think SQL allows you to do this. I didn't get what u said about INSERT OR REPLACE looks good.
Regards, Phani -----Original Message----- From: Trey Mack [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 24, 2007 9:11 PM To: sqlite-users@sqlite.org Subject: [sqlite] INSERT OR REPLACE without new rowid Hello all, I'd like to perform an update to a row if it exists (uniquely identified by 3 text columns), otherwise insert a new row with the right data. INSERT OR REPLACE looks good, but it generates a new primary key each time there is a conflict. If the row exists, I need to keep the original primary key (rowid). Any way to do this short of SELECT.. if (exists) UPDATE else INSERT ? Thanks, Trey ------------------------------------------------------------------------ ----- To unsubscribe, send email to [EMAIL PROTECTED] ------------------------------------------------------------------------ ----- ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------