May 2018
Intermediate to advanced
576 pages
30h 25m
English
There is yet another question posed by updatable views.
As an example, we shall use the cust_minor view we just defined, which does not allow performing insertions or updates such that the affected rows fall out of the view itself. For instance, consider this query:
UPDATE cust_minor SET age = 19 WHERE customerid = 123;
The preceding query will not affect any row because of the WHERE age < 18 conditions in the rule definition.
The CREATE VIEW statement has a WITH CHECK OPTION clause; if specified, any update which excludes any row from the view will fail.
If a view includes some updatable columns together with other non-updatable columns (for example expressions, literals, and so on), then updates are allowed if they only change ...