CREATE/REPLACE VIEW SQL Statement | Teradata Vantage - CREATE VIEW and REPLACE VIEW - Teradata Vantage - Analytics Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-22
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantage™

Creates or replaces a view on a set of tables or views or both.

REPLACE VIEW redefines an existing view or, if the specified view does not exist, creates a new view with the specified name. Privileges that were granted directly on the original view are retained for the replace view definition.

For information about the temporal forms of CREATE VIEW and REPLACE VIEW, see Teradata Vantage™ - ANSI Temporal Table Support, B035-1186 and Teradata Vantage™ - Temporal Table Support, B035-1182.

ANSI Compliance

CREATE VIEW is ANSI SQL:2011-compliant.

REPLACE VIEW is a Teradata extension to the ANSI SQL:2011 standard.

Required Privileges: CREATE VIEW

To create a view, you must have the CREATE VIEW privilege.

The creator receives the DROP VIEW, INSERT, UPDATE, DELETE, and SELECT privileges on the newly created view WITH GRANT OPTION.

If a user other than the owner accesses a view, then all of the relevant privileges needed by the immediate owner of the view to access underlying tables and views must also be held by the immediate owner of the view WITH GRANT OPTION.

You must have the following privileges to update a table through a view.

User Privileges Required
Immediate owner of view
  • UPDATE on the view.
  • UPDATE on the table.
Other users
  • UPDATE on the view.
  • UPDATE WITH GRANT OPTION on the table.

You must have the following privileges to delete rows from a table through a view:

User Privileges Required
Immediate owner of view
  • DELETE on the view.
  • DELETE on the table.
Other users
  • DELETE on the view.
  • DELETE WITH GRANT OPTION on the table.

You must have the following privileges to update or delete rows from a table using a search condition through a view:

User Privileges Required
Immediate owner of view
  • SELECT ACCESS on the view.
  • SELECT ACCESS on the table.
Other users
  • SELECT ACCESS on the view.
  • SELECT ACCESS WITH GRANT OPTION on the objects specified in the search condition list.

Required Privileges: REPLACE VIEW

You must have the relevant preceding privileges and the following additional privileges to replace a view:
  • DROP VIEW privilege.
  • CREATE VIEW privilege if the specified view does not exist.

Privileges Granted Automatically

When you create a new view, the following privileges are automatically granted to the view:
  • DELETE
  • DROP VIEW
  • GRANT
  • INSERT
  • SELECT
  • UPDATE