Database object dependencies


In DB2 database objects are dependent on each other. Like views depends on a table, stored procedures depends on the table or views or functions and so on. So if you are trying to create a view then ideally the corresponding table should exist on the database but if the table is not there and you want to create a view then how will you create a view ? Refer to the following table and view dependencies.














Solution


Beginning with version 9.7 you can configure DB2 to allow creation of objects with certain types of warning such as missing dependent objects. This capability can be useful for database object creation, design, and modification because it permits you to have a random order of CREATE commands. It also allows you to verify the syntax of new views and procedures without creating the objects they depend on. With DB2 9.7 objects can be revalidated automatically.

With DB2 9.7 user can create the views and tables in any order they like, object revalidation will happen automatically.


Prerequisites


This tutorial requires that the AUTO_REVAL database configuration parameter be set to DEFERRED_FORCE.

The view to the right pane displays the current value. If it is not set to DEFERRED_FORCE, you can press the change button and change it to DEFERRED_FORCE.