On Thu, Sep 16, 2010 at 10:00 PM, Mladen Gogala
<mladen.gogala@vmsinfo.com> wrote:
> I always wandered why would anybody want to update a view? View is, by
> definition, a stored query which is executed frequently enough to be given
> its own first name, middle name and a family name. If the view is being
> updated, the middle name is F, just as in the case of Bucky Dent. I don't
> see any database design pattern which would necessitate updating a view.
> That is a perversion, not unlike putting ketchup on a hot dog.
See C.J. Date's "SQL and Relational Theory", a good read. Page 195,
"SQL and Views: Update Operations" talks about this. Quote:
>> The Principle of Interchangeability implies that views must be
>> updatable (i.e., assignable to) ... [snip] ... updates on base relvars can
>> always fail on integrity constraint violations—and the same is true
>> for updates on views. In other words, it isn’t that some views are
>> inherently nonupdatable, but rather that some updates on some
>> views will fail on integrity constraint violations (i.e., violations of
>> The Golden Rule).
On page 197 Date gives an excerpt from SQL99 that defines when a view
is updatable, see page 269 of SQL99 here:
http://www.cs.pdx.edu/~len/sql1999.pdf
Josh