SQLite Forum

insert into view returning id returns null
I'm playing with insertable views and returning clause


	create table foo (id integer primary key, name text);

	create view bar as select * from foo;

	create trigger bar_insert
		instead of insert on bar for each row
		begin insert into foo (name) values (new.name); end

When executing insert into view  (using snapshot - SQLite version 3.37.0 2021-07-19 14:00:29)

	insert into bar (name) values ('a') returning id;

I get one row with one column, but its value is NULL.

Modification of data is successful otherwise, even when inserting into multiple tables.