Progress
SQL-89
Guide and Reference


CREATE VIEW Statement

Creates a view from one or more base tables, other views, or both.

SYNTAX
CREATE VIEW view-name [ ( column [ , column ] ... ) ]
  AS SELECT-statement [ WITH CHECK OPTION ] 

view-name

The name of the view you want to create.

column [ , column ] ...

The names of the columns in the view. If you do not specify column names, Progress/SQL uses the column names in the SELECT statement. If the select list includes expressions or duplicate column names, you must specify column names for the view.

AS SELECT-statement

Defines how to derive the data for the view. The SELECT statement within a CREATE VIEW statement cannot contain an ORDER BY clause or a WITH clause. If you use the following syntax elements, you cannot update data in the view:

WITH CHECK OPTION

Ensures that all updates to the view satisfy the view-defining condition in the WHERE clause of the SELECT-statement. You cannot specify this option if the view is non-updatable.

EXAMPLE

This example creates a table view called doc from an employee in the Documentation department.

CREATE VIEW Doc                                     
  AS SELECT Emp_Num, Name, Job
    FROM Employee
    WHERE Dept = ’Documentation’. 

NOTES

SEE ALSO

CREATE SCHEMA Statement (ESQL Only), DROP VIEW Statement, GRANT Statement, REVOKE Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095