Who Can Drop a View?
The DROP VIEW
statement can be executed by:
-
The owner of the view
-
Users with the
DROP ANY VIEW
privilege
The DROP VIEW
statement can be executed by:
The owner of the view
Users with the DROP ANY VIEW
privilege
PRICE_WITH_MARKUP
viewDROP VIEW PRICE_WITH_MARKUP;
RECREATE VIEW
Drops a view if it exists, and creates a view
DSQL
RECREATE VIEW viewname [<full_column_list>] AS <select_statement> [WITH CHECK OPTION] <full_column_list> ::= (colname [, colname ...])
Parameter | Description |
---|---|
viewname |
View name.The maximum length is 63 characters |
select_statement |
SELECT statement |
full_column_list |
The list of columns in the view |
colname |
View column name.Duplicate column names are not allowed. |
Creates or recreates a view.If there is a view with this name already, the engine will try to drop it before creating the new instance.If the existing view cannot be dropped, because of dependencies or insufficient rights, for example, RECREATE VIEW
fails with an error.
RECREATE VIEW
PRICE_WITH_MARKUP
view or recreating it, if it already existsRECREATE VIEW PRICE_WITH_MARKUP (
CODE_PRICE,
COST,
COST_WITH_MARKUP
) AS
SELECT
CODE_PRICE,
COST,
COST * 1.15
FROM PRICE;