17.05 - Inserting Rows through Views - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1146-175K
Language
English (United States)

Use caution when granting the privilege to insert data through a view because data in fields not visible to the user might be inserted when a row is inserted through a view.

The following rules apply to inserting rows through a view:
  • Both you and the immediate owner of the view must have the appropriate privileges.
  • The view must reference columns in only one table or view.
  • None of the columns in the view can be derived by using an expression to change values in the underlying table.
  • Each column in the view must correspond one to one with a column in the underlying table or view.
  • The view must include any column in the underlying table or view that is declared as NOT NULL.
  • No two view columns can reference the same column in the underlying table.
  • If the request used to define a view contains a WHERE clause, and WITH CHECK OPTION, all values inserted through that view must satisfy constraints specified in the WHERE clause.

    If a view includes a WHERE clause but does not include the WITH CHECK OPTION, then data can be inserted that is not visible through that view.