8. SQL Statements : CREATE VIEW : Syntax
 
Share this page                  
Syntax
The CREATE VIEW statement has the following format:
[EXEC SQL] CREATE VIEW view_name
               [(column_name {, column_name})]
               AS [WITH common_table_expression] select_stmt
              [WITH CHECK OPTION]
view_name
Defines the name of the view. It must be a valid object name.
AS [WITH common_table_expression] select_stmt
Creates a view from the criteria specified in the select_stmt. The select_stmt is a SELECT statement, as described in the SELECT statement description in this chapter.
The SELECT can be preceded by a common table expression (see page WITH (common_table_expression)).
WITH CHECK OPTION (see page With Check Option Clause)
Prevents an INSERT or UPDATE to a view that creates a row that does not comply with the view definition.