Contents Index ALTER TRIGGER statement ALTER WRITEFILE statement

ASA SQL Reference
  SQL Statements

ALTER VIEW statement


Description 

Use this statement to replace a view definition with a modified version. You must include the entire new view definition in the ALTER VIEW statement.

Syntax 1 

ALTER VIEW
owner.]view-name [ ( column-name, ... ) ] AS select-statement
WITH CHECK OPTION ]

Syntax 2 

ALTER VIEW
owner.]view-name SET HIDDEN

Usage 

Syntax 1    The ALTER VIEW statement is identical in syntax to the CREATE VIEW statement except for the first word. The ALTER VIEW statement replaces the entire contents of the CREATE VIEW statement with the contents of the ALTER VIEW statement. Existing permissions on the view are maintained, and do not have to be reassigned. If a DROP VIEW followed by a CREATE VIEW is used, instead of ALTER VIEW, permissions on the view would have to be reassigned.

Syntax 2    You can use SET HIDDEN to scramble the definition of the associated view and cause it to become unreadable. The view can be unloaded and reloaded into other databases.

This setting is irreversible. If you will need the original source again, you must maintain it outside the database.

If SET HIDDEN is used, debugging using the stored procedure debugger will not show the view definition, nor will it be available through procedure profiling.

For information on the keywords and options, see CREATE VIEW statement.

Permissions 

Must be owner of the view or have DBA authority.

Side effects 

Automatic commit.

All procedures and triggers are unloaded from memory, so that any procedure or trigger that references the view reflects the new view definition. The unloading and loading of procedures and triggers can have a performance impact if you are regularly altering views.

See also 

CREATE VIEW statement

DROP statement

Hiding the contents of procedures, functions, triggers and views

Standards and compatibility 

Contents Index ALTER TRIGGER statement ALTER WRITEFILE statement