Re: [sqlite] rowid changing....

2016-09-19 Thread Dominique Devienne
On Sun, Sep 18, 2016 at 4:19 PM, mikeegg1 wrote: > Thanks everyone. I was mis-equating REPLACE with UPDATE. I’ll change my > code to “INSERT or IGNORE” and add an UPDATE. > For info, that's a common gotcha with SQLite. See [1] from 2-months ago, but I'm sure the archives are

Re: [sqlite] rowid changing....

2016-09-18 Thread mikeegg1
Thanks everyone. I was mis-equating REPLACE with UPDATE. I’ll change my code to “INSERT or IGNORE” and add an UPDATE. Mike > On Sep 18, 2016, at 05:34, Keith Medcalf wrote: > > > On Saturday, 17 September, 2016 21:35, mikeeggl asked: > >> In my DDL I have “integer

Re: [sqlite] rowid changing....

2016-09-18 Thread Keith Medcalf
On Saturday, 17 September, 2016 21:35, mikeeggl asked: > In my DDL I have “integer primary key not null” on my tables. When I do > the first insert to these tables the rowid is assigned. The insert > statement is a “insert or replace into…” so I don’t have to deal with > insertion errors.

Re: [sqlite] rowid changing....

2016-09-18 Thread Simon Slavin
On 18 Sep 2016, at 7:21am, Clemens Ladisch wrote: > mikeegg1 wrote: >> The insert statement is a “insert or replace into…” so I don’t have to >> deal with insertion errors. However, I expected the rowid to not change >> when the row has not changed. > > The OR REPLACE

Re: [sqlite] rowid changing....

2016-09-18 Thread Clemens Ladisch
mikeegg1 wrote: > The insert statement is a “insert or replace into…” so I don’t have to > deal with insertion errors. However, I expected the rowid to not change > when the row has not changed. The OR REPLACE clause just deletes any old row. If you want to update the old row, use UPDATE. (And