SQL/MP Version Management Guide

Database Versions
Compaq NonStop™ SQL/MP Version Management Guide429833-001
3-17
Object-Version Dependencies
DROP and Object Versions
These rules determine how DROP affects object version and depend on the type of
object being dropped:
DROP TABLE drops all objects dependent on the dropped table. The versions of
objects remaining after you use DROP TABLE are not affected. For example, if you
drop a table, any views dependent on the table are also dropped.
DROP VIEW drops all views dependent on the dropped view. The versions of any
objects that remain after DROP VIEW is executed are not affected.
DROP CONSTRAINT can lower the version of the table associated with the
constraint being dropped and the version of any views dependent on the table. For
example, suppose a constraint on a table uses a version 300 collation and no version
300 features are in the table. If you drop the version 300 constraint, the version of
the table and of any dependent views is lowered from version 300 to version 1 or
version 2, depending on the versions of other features of the table.
DROP INDEX can lower the version of the base table for the index and the version
of any version-dependent objects. For example, suppose an index is a version 300
index because it uses collations, and that is the only reason its base table is version
300. If you drop the index, the version of the table is lowered to version 1 or version
2, depending on the version of other features. If any views dependent on the table
are version 300 views only because the table version was 300, their version is also
lowered.
DROP COLLATION cannot be executed if the collation to be dropped has any
dependent objects. This rule means that dropping a collation cannot change the
version of any objects.
ALTER and Object Versions
When you alter an SQL object, you alter also the version of any objects whose version
depends on the altered object.
Before you alter an object, check that the version of the catalog in which the object is to
be registered is new enough to register the altered object. If you attempt to alter the
version of an object by executing an ALTER command and the catalog version is older
than the version of the altered object, the ALTER statement fails with a version error.
If an altered object is to be registered in more than one catalog because the object is
partitioned, check the version of each affected catalog to determine whether the catalog
version is as new as that of the altered object.
To avoid version errors, upgrade all affected catalogs before altering any object in a way
that raises its version. If you alter an object in a way that lowers its version, you need
not be concerned about the current catalog version, because an older-version object can
be registered in a newer-version catalog.
These rules determine how ALTER affects object version and depend on the type of
object being altered: