Modifying typed views
Certain properties of a typed view can be changed without requiring the view to be dropped and recreated. One such property is the adding of a scope to a reference column of a typed view.
About this task
The ALTER VIEW statement modifies an existing typed view
definition by altering a reference type column to add a scope. The
DROP statement deletes a typed view. You can also:
- Modify the contents of a typed view through INSTEAD OF triggers
- Alter a typed view to enable statistics collection
Changes you make to the underlying content of a typed view require that you use triggers. Other changes to a typed view require that you drop and then re-create the typed view.
The data type of the column-name in the ALTER VIEW statement must be REF (type of the typed table name or typed view name).
Procedure
To alter a typed view by using the command line, issue
the ALTER VIEW statement.
For example:
ALTER VIEW view_name ALTER column_name
ADD SCOPE typed_table_or_view_name
Results
Other database objects such as tables and indexes are not affected although packages and cached dynamic statements are marked invalid.