ODBC Server Reference Manual
CORE SQL Language
HP NonStop ODBC Server Reference Manual—429151-002
3-43
CREATE VIEW
CREATE VIEW
Use CREATE VIEW to create a view.
The file security for the view is obtained from the default permissions associated with
the user’s logon name.
The CREATE VIEW statement has the following syntax:
table-name
identifies the view to create.
You can specify the owner of a view, but you cannot specify the database. (You
can create a view only in the current database.)
column-identifier
specifies the alternate column names for the columns of the view. The column-
identifier must be unique for columns defined in the view.
If you omit the column-identifier list, the column names of the view take the
names from the columns in the select list of the query-specification.
query-expression
is a query-specification or a union of multiple query specifications.
query-specification
is a SELECT statement that defines the columns for the view and sets the
selection criteria. Unless you declare alternate column names in the column-
identifier list, the column names you specify in the query-specification
define the column names of the view.
Tables in the query-specification must be in the current database or be
qualified by their database name.
If there is only one table referenced by the view, NonStop ODBC automatically
creates a protection view.
CREATE VIEW table-name
[ ( column-identifier [, column-identifier ] ... ) ]
AS query-expression
query-expression is:
{ query-expression UNION [ALL] query-expression }
{ ( query-expression ) }
{ query-specification }