A view definition can refer to other objects including columns, tables, and other views. When a view makes a reference to another object, the view is called a referencing object and the object to which it refers is called a referenced object. Further, a referencing object is said to be dependent on the objects to which it refers.
The set of referenced objects for a given view includes all of the objects to which it refers either directly or indirectly. For example, a view can indirectly refer to a table, by referring to another view that references that table.
Consider the following set of tables and views:
CREATE TABLE t1 ( c1 INT, c2 INT ); CREATE TABLE t2( c3 INT, c4 INT ); CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v2 AS SELECT c3 FROM t2; CREATE VIEW v3 AS SELECT c1, c3 FROM v1, v2; |
The following view dependencies can be determined from the definitions above:
The database server keeps track of columns, tables, and views referenced by a given view. The database server uses this dependency information to ensure that schema changes to referenced objects do not leave a referencing view in an unusable state. The following tables explains how view dependencies affects regular and materialized views.
Dependencies and schema-altering changes
View dependency information in the catalog
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |