Database Reference
In-Depth Information
Figure 19.4
A Complex Query
Is Simplified with a
View.
WHERE TITLE='Soak Up the Sun' ORDER BY 1,2;
19.4
Changing and Dropping Views
Syntax for changing and dropping views is as shown in Figure 19.6. Note
that nearly all syntax for the ALTER VIEW command applies to con-
straints. Constraints are covered in Chapter 20.
What happens if you drop a table that is used in a view? The view
becomes marked invalid and must be repaired.
Sometimes you may have a new requirement from users that calls for a
change in a view. Views are much easier to change than tables because they
are generally nothing more than a stored query. Revise the stored query, and
you have revised the view!
To change a view, you revise the query and use the OR REPLACE
option in the CREATE VIEW command, as in CREATE OR REPLACE
VIEW. This assumes, of course, that constraint changes are not required.
 
Search WWH ::




Custom Search