When the basis of the view changes
The tables and views on which you base a view can change in several ways. The view automatically reflects most of the changes.
When you drop a table or view, any views in the same database that depend on that table or view are automatically dropped.
The only way to alter the definition of a view is to drop and re-create it. Therefore, if you change the definition of a view on which other views depend, you must also re-create the other views (because they all are dropped).
CREATE VIEW name_only AS
SELECT customer_num, fname, lname FROM customer
RENAME COLUMN customer.lname TO surname
SELECT fname, surname FROM customer
SELECT fname, lname FROM name_only
When you drop a column to alter a table, views are not modified. If views are used, error -217 (Column not found in any table in the query) occurs. The reason views are not modified is that you can change the order of columns in a table by dropping a column and then adding a column of the same name. Views based on that table continue to work and they retain their original sequence of columns.
You can base a view on tables and views in external databases. Changes to tables and views in other databases are not reflected in views. Such changes might not be apparent until someone queries the view and gets an error because an external table changed. For example, if a column in a remote object that is included in a view is altered to have a different type, you must drop and re-create the view.