On 16 Mar 2018, at 12:43pm, Robert M. Münch <robert.mue...@saphirion.com> wrote:

> On 16 Mar 2018, at 11:35, Simon Slavin wrote:
> 
>> You can use INSERT OR IGNORE for this.  First, do an INSERT OR IGNORE 
>> command which will add a dummy entry, with the right key, if one doesn't 
>> already exist.
>> …
> 
> Hi, yes, I thought about this too but really don’t like it and this assumes 
> that you don’t use AUTOINCREMENT on a table otherwise this strategy will fail.

There's no problem with AUTOINCREMENT.  Your UPDATE command should be using 
your own key values, not a rowid generated automatically.

But yes, if you have other objections against using INSERT OR IGNORE then there 
are alternatives.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to