|Oracle8i SQL Reference
Release 3 (8.1.7)
Part Number A85397-01
ALTER TABLE to constraint_clause, 7 of 14
VIEW statement to explicitly recompile a view that is invalid. Explicit recompilation allows you to locate recompilation errors before run time. You may want to recompile a view explicitly after altering one of its base tables to ensure that the alteration does not affect the view or other objects that depend on it.
When you issue an
VIEW statement, Oracle recompiles the view regardless of whether it is valid or invalid. Oracle also invalidates any local objects that depend on the view.
The view must be in your own schema or you must have
TABLE system privilege.
Specify the schema containing the view. If you omit
schema, Oracle assumes the view is in your own schema.
Specify the name of the view to be recompiled.
COMPILE keyword is required. It directs Oracle to recompile the view.
To recompile the view
customer_view, issue the following statement:
If Oracle encounters no compilation errors while recompiling
customer_view becomes valid. If recompiling results in compilation errors, Oracle returns an error and
customer_view remains invalid.
Oracle also invalidates all dependent objects. These objects include any procedures, functions, package bodies, and views that reference
customer_view. If you subsequently reference one of these objects without first explicitly recompiling it, Oracle recompiles it implicitly at run time.