Re: [sqlite] Fastest way to check if new row or update existing one?

2007-12-31 Thread John Stanton
Did you try using INSERT OR REPLACE? Hugo Ferreira wrote: Hmmm... Would it be possible to make a trigger on a table such that if any update fails, it does an insert? If so, then one would only need to issue updates. On Dec 26, 2007 11:35 AM, Kees Nuyt [EMAIL PROTECTED] wrote: On Wed, 26

Re: Re[2]: [sqlite] Fastest way to check if new row or update existing one?

2007-12-31 Thread Kees Nuyt
On Mon, 31 Dec 2007 13:54:50 +, Hugo Ferreira [EMAIL PROTECTED] wrote: Hmmm... Would it be possible to make a trigger on a table such that if any update fails, it does an insert? If so, then one would only need to issue updates. I don't think that would be possible, an update trigger most

Re[2]: [sqlite] Fastest way to check if new row or update existing one?

2007-12-26 Thread Ion Silvestru
QUESTION: is there a better way to make this important decision? using Sqlite INSERT OR REPLACE may work for you. There is a problem with INSERT OR REPLACE in that REPLACE is not truly replace, but is delete + insert (existing row is deleted and new row is added), or I am wrong? If I am

Re: Re[2]: [sqlite] Fastest way to check if new row or update existing one?

2007-12-26 Thread Kees Nuyt
On Wed, 26 Dec 2007 10:17:43 +0200, Ion Silvestru [EMAIL PROTECTED] wrote: QUESTION: is there a better way to make this important decision? using Sqlite INSERT OR REPLACE may work for you. There is a problem with INSERT OR REPLACE in that REPLACE is not truly replace, but is delete + insert

[sqlite] Fastest way to check if new row or update existing one?

2007-12-25 Thread Mag. Wilhelm Braun
hi, just a short question to speed up: as with any database one has quite often to decide if we *INSERT a NEW row -- or -- UPDATE an existing row* at the moment I do a check select on an unique ID intege which is resonable fast: code:

Re: [sqlite] Fastest way to check if new row or update existing one?

2007-12-25 Thread Kees Nuyt
On Tue, 25 Dec 2007 15:07:12 +0100, Mag. Wilhelm Braun [EMAIL PROTECTED] wrote: hi, just a short question to speed up: as with any database one has quite often to decide if we *INSERT a NEW row -- or -- UPDATE an existing row* at the moment I do a check select on an unique ID intege which is