Alters a view.
Rename a view
Renames an existing view.
- Syntax
alter view <view_name> rename to <new_view_name>;
- Parameters
- view_name: required. The name of the view that you want to rename.
- new_view_name: required. The new name of the view. If a view with the same name already exists, an error is returned.
- Examples
-- Rename the sale_detail_view view as market. alter view sale_detail_view rename to market;
Change the owner of a view
Changes the owner of an existing view.
- Syntax
alter view <view_name> changeowner to <new_owner>;
- Parameters
- view_name: required. The name of the view whose owner you want to change.
- new_owner: required. The new owner of the view.
- Examples
-- Change the owner of the sale_detail_view view to ALIYUN$xxx@aliyun.com. alter view sale_detail_view changeowner to 'ALIYUN$xxx@aliyun.com';
Related statements
- CREATE VIEW: Creates a view or updates an existing view based on a query statement.
- DESC VIEW: Views the information about an existing view.
- DROP VIEW: Drops an existing view.