O'Reilly logo

Practical SQL Handbook, The: Using SQL Variants, Fourth Edition by Sandra L. Emerson, Marcy Darnovsky, Judith S. Bowman

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

The Rules According to ANSI

The ANSI standard declares that views are read-only (not modifiable) if the CREATE VIEW statement contains any of the following:

  • DISTINCT in the select list

  • Expressions (computed columns, aggregates, functions, and so on) in the select list

  • References to more than one table—in the FROM clause or in a subquery or in a UNION clause

  • References to a view that is itself not updatable, either in the FROM clause or in a subquery

  • A GROUP BY or HAVING clause

Some dialects of SQL are less restrictive than the ANSI standard; others may be more restrictive. You can consult your reference manual, or you can experiment. When you try to modify data through a view, SQL checks to make sure that no restrictions are violated. If it detects ...

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