[sqlite] update of view via trigger

2015-03-06 Thread Igor Tandetnik
On 3/5/2015 11:58 PM, Igor Tandetnik wrote: > If the latter is OK, then you can have a single trigger doing something > like this: > > insert or replace into Clean(X, Y, Z) > select > case when new.X = ifnull(c.X, d.X) then c.X else new.X end, > case when new.Y = ifnull(c.Y, d.Y) then c.Y

[sqlite] update of view via trigger

2015-03-06 Thread Scott Robison
On Mar 6, 2015 7:33 AM, "Igor Tandetnik" wrote: A bunch of good stuff snipped... Thanks for the alternative suggestions. In thinking it over since my message, I've decided the multiple trigger approach isn't at all bad. A little verbose, but each column of the view has its own callback and

[sqlite] update of view via trigger

2015-03-05 Thread Igor Tandetnik
On 3/5/2015 9:56 PM, Scott Robison wrote: > Finally, my question: Is there some sort of syntax that I'm missing that > would "simplify" my schema with a single update trigger, or is this the > proper way to "update" individual columns of a view? Imagine that the "clean" table has null in column X

[sqlite] update of view via trigger

2015-03-05 Thread Scott Robison
I have a use case to update a view, and wanted to make sure I'm not missing anything obvious. The basics of my schema are that I have a table from a third party that might be updated at any time. A lot of the data in that table is garbage though, and I want cleaner data, so I have a parallel