FirebirdSQL logo

RECREATE VIEW

Drops a view if it exists, and creates a view

Available in

DSQL

Syntax
RECREATE VIEW viewname [<full_column_list>]
  AS <select_statement>
  [WITH CHECK OPTION]

<full_column_list> ::= (colname [, colname ...])
Table 1. RECREATE VIEW Statement Parameters
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.

Example of RECREATE VIEW

Creating the new view PRICE_WITH_MARKUP view or recreating it, if it already exists
RECREATE VIEW PRICE_WITH_MARKUP (
  CODE_PRICE,
  COST,
  COST_WITH_MARKUP
) AS
SELECT
  CODE_PRICE,
  COST,
  COST * 1.15
FROM PRICE;