O'Reilly logo

Joe Celko's Thinking in Sets: Auxiliary, Temporal, and Virtual Tables in SQL by Joe Celko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

17.4. Operations on VIEWs as Constraints

VIEWs are virtual, logical tables that are from base tables in the physical schema. Ideally, the user should not be aware of the differences between a VIEW and a base table. Unfortunately, UPDATE, DELETE, or INSERT operations cannot be done directly on a VIEW. The operations have to resolve down to persistent base tables.

17.4.1. The Basic Three Operations

A base table is always updatable, but VIEWs are not always updatable. All an SQL engine knows about a VIEW is its definition, namely the query that specifies the table derived by the VIEW. An optimizer might be able to detect indexing and constraints on the base tables to construct an execution plan, but this can be pretty complicated.

There are three ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required