CREATE VIEW
Creates a view
DSQL
CREATE 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. |
The CREATE VIEW
statement creates a new view.The identifier (name) of a view must be unique among the names of all views, tables, and stored procedures in the database.
The name of the new view can be followed by the list of column names that should be returned to the caller when the view is invoked.Names in the list do not have to be related to the names of the columns in the base tables from which they derive.
If the view column list is omitted, the system will use the column names and/or aliases from the SELECT
statement.If duplicate names or non-aliased expression-derived columns make it impossible to obtain a valid list, creation of the view fails with an error.
The number of columns in the view’s list must match the number of columns in the selection list of the underlying SELECT
statement in the view definition.
Note
|
Additional Points
|