INSERT/UPDATE generated columns?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

INSERT/UPDATE generated columns?

nomad
The gencol.html document does not describe the result of attempting to
INSERT INTO or UPDATE a generated column. Does this raise an error (my
preference) or is it simply ignored? Could the behaviour be added to
the documentation?

--
Mark Lawrence
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: INSERT/UPDATE generated columns?

Keith Medcalf

On Tuesday, 29 October, 2019 20:48, [hidden email] wrote:

>The gencol.html document does not describe the result of attempting to
>INSERT INTO or UPDATE a generated column. Does this raise an error (my
>preference) or is it simply ignored? Could the behaviour be added to
>the documentation?

sqlite> create table t(data, updated as (current_timestamp) stored);
sqlite> insert into t (data, updated) values (1,45);
Error: cannot INSERT into generated column "updated"
sqlite> insert into t (data) values (1);
sqlite> update t set updated=4;
Error: cannot UPDATE generated column "updated"

It thows an error during the prepare ...

--
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.




_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users