FairCom Corporation


2.12 CREATE VIEW


Description

Creates a view with the specified name on existing tables and/or views.

Syntax

CREATE VIEW [ owner_name. ] view_name
[ ( column_name, column_name,... ) ]
AS [ ( ] query_expression [ ) ]
[ WITH CHECK OPTION ] ;

Notes

Examples

CREATE VIEW ne_customers AS
SELECT cust_no, name, street, city, state, zip
FROM customer
WHERE state IN ('NH', 'MA', 'NY', 'VT')
WITH CHECK OPTION ;
CREATE VIEW order_count (cust_number, norders) AS
SELECT cust_no, COUNT(*)
FROM orders
GROUP BY cust_no;

Authorization

The user executing this statement must have the following privileges:

If owner_name is specified and is different from the name of the user executing the statement, then the user must have DBA privilege.

SQL Compliance
SQL-92, ODBC Core SQL grammar
Environment
Embedded SQL, interactive SQL, ODBC applications
Related Statements
Query Expressions, DROP VIEW


FairCom Corporation
www.faircom.com