Usage
SQL
ALTER VIEW name[column_name column_type, ..., PRIMARY KEY(column_name)] AS queryExpression
Syntax Rules
- The
ALTER
query expression may be prefixed with a cache hint for materialized view definitions. The hint will take effect the next time the materialized view table is loaded; PRIMARY KEY
, which uniquely identifies each record in a table, must contain a unique value and cannot be null;- The number of columns in
queryExpression
must not be changed.
Example
SQL
CREATE VIEW views.creditcard AS SELECT * FROM adventureworks.creditcard;
ALTER VIEW views.creditcard AS SELECT * from (SELECT * FROM adventureworks.creditcard) a;
ALTER VIEW views.creditcard(a integer, b integer, PRIMARY KEY(a)) AS SELECT * FROM adventureworks.creditcard;