Apologies, it seems you got lots of replies explaining why, but I failed
to mention how it would work.
Try this in your code:
CREATE TABLE messages (id numeric PRIMARY KEY);
insert or replace into messages values (1);
insert or replace into messages values (1);
insert or replace into messages v
On 2016/03/09 5:03 PM, Tilsley, Jerry M. wrote:
> All,
>
> I'm trying to use the INSERT OR REPLACE syntax so that I don't have to worry
> about duplicate entries without creating a trigger. Using the schema:
> CREATE TABLE messages (id numeric);
>
> and using the SQL:
> insert or replace into m
Tilsley, Jerry M. wrote:
> CREATE TABLE messages (id numeric);
>
> insert or replace into messages values (1);
>
> Why does this result in multiple rows of the same value?
INSERT OR REPLACE deletes any old row that would cause a UNIQUE
constraint violation.
Without a UNIQUE (or PRIMARY KEY) const
at mailinglists.sqlite.org] Im Auftrag von
Tilsley, Jerry M.
Gesendet: Mittwoch, 09. M?rz 2016 16:03
An: sqlite-users at mailinglists.sqlite.org
Betreff: [sqlite] Insert or Replace Trouble
All,
I'm trying to use the INSERT OR REPLACE syntax so that I don't have to worry
about duplica
All,
I'm trying to use the INSERT OR REPLACE syntax so that I don't have to worry
about duplicate entries without creating a trigger. Using the schema:
CREATE TABLE messages (id numeric);
and using the SQL:
insert or replace into messages values (1);
Why does this result in multiple rows of th
5 matches
Mail list logo