That's normal. It deletes the conflicting row and inserts a new one.

On Tue, Oct 23, 2018, 10:58 AM Roman Fleysher <
roman.fleys...@einstein.yu.edu> wrote:

> Dear SQLiters,
>
> I am using INSERT OR REPLACE to update a table which holds a column which
> servers as a foreign key. But I noticed a strange behavior: If the parent
> record existed, then replace mechanism replaces it, but the records from
> children tables are deleted. The foreign key is set up to cascade on
> delete, as I think it should. So it seems that "replace" is implemented as
> "delete then insert" rather than "update". Is that normal and expected? Am
> I doing something wrong?
>
> Thank you,
>
> Roman
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to