Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Working with Database Objects

Copying tables or columns within or between databases Next Page

Working with views

Views are computed tables. You can use views to show database users exactly the information you want to present, in a format you can control. SQL Anywhere supports two types of views: non-materialized views, also referred to as just views, and materialized views. The two types of view differ in that non-materialized views are recomputed each time you invoke them. Materialized views are computed, stored on disk similar to a base table, and need their data refreshed periodically.

Since materialized views are stored and managed slightly differently, their tasks are documented separately. If you want information about materialized views, see Working with materialized views.

Views have a status associated with them that indicates whether the data they contain is up to date, and whether they are available to answer a query. See View status.

Comparing materialized views, non-materialized views, and base tables

The following table highlights the things you can and cannot do with views and tables.

CapabilityMaterialized viewsNon-materialized viewsBase tables
Allow access permissionsYesYesYes
Allow SELECT on themYesYesYes
Allow UPDATENoSomeYes
Allow INSERTNoSomeYes
Allow DELETENoSomeYes
Allow dependent viewsYesYesYes
Allow indexesYesNoYes
Allow integrity constraintsNoNoYes
Allow keysNoNoYes
Benefits of using views

Views let you tailor access to data in the database. Tailoring access serves several purposes:

Creating views
Using views
Using the WITH CHECK OPTION clause
Altering views
Dropping views
Enabling and disabling views
View dependencies
Browsing data in views
Viewing system table data
Working with materialized views