SQLite Forum

Timeline
Login

1 forum post by user mkSqliteId

2021-10-13
12:53 Post: inconsistent output: insert on conflict with returning (artifact: b2dc888367 user: mkSqliteId)
create temp table foo (name text unique);
insert into foo values ('name1') on conflict(name) do nothing returning *;
-->output: name1
insert into foo values ('name1') on conflict(name) do nothing returning *;
-->output: no output here

drop table foo;
create temp table foo (name text unique, amount int);
insert into foo values ('name1', 0) on conflict(name) do update set amount=excluded.amount returning *;
-->output: name1|0
insert into foo values ('name1', 1) on conflict(name) do update set amount=excluded.amount returning *;
-->output: no output here

Thanks.