SQL/MP Version Management Guide

Database Versions
Compaq NonStop™ SQL/MP Version Management Guide429833-001
3-13
Retrieving Object Versions
in the corresponding OBJECTVERSION columns in the TABLES and INDEXES
catalog tables.
You can invoke the SQL VERIFY utility to make sure that version information recorded
in an OBJECTVERSION column matches the version information stored in the file
label of any table, view, index, or collation.
The VERIFY utility checks version consistency for:
Each specified object (except constraints)
Each partition of each specified table, index, or protection view
Any indexes or protection views based on each specified table, but not the partitions
of the indexes or protection views
Version numbers stored in file labels and catalog tables should be consistent. If the
numbers are not consistent, you might have to drop any objects with inconsistent version
information and then re-create the objects.
For a description of the VERIFY utility, see the NonStop SQL/MP Reference Manual.
Retrieving Object Versions
You can retrieve the version of a table, index, view, or collation in any of these ways:
By executing the GET VERSION statement
By querying the user catalog tables
By calling the SQLGETOBJECTVERSION procedure
By executing the SQL FILEINFO command by using the DETAIL option
Because the version of a constraint is not stored in a catalog table or in a file label, you
can determine the version of a constraint only by examining its features. For example,
because collations are a version 300 feature, the version of a constraint defined with a
COLLATE clause is always 300 or newer.
For more information on the features that determine constraint versions, see
Appendix A, Summary of Feature, Catalog, and Data Structure Changes
.
Using the GET VERSION Statement
The GET VERSION statement, when followed by the name of an SQL object, returns
the SQL object version of the specified object. The object can be a table, index, view, or
collation. You can execute the GET VERSION statement from a static or dynamic SQL
program, or you can execute it as a command using SQLCI.
The GET VERSION statement is not available to version 1 or version 2 SQL software;
you must execute GET VERSION from a node running version 300 or newer software.
In a network, you can execute the GET VERSION statement to retrieve the version of
an object on a remote node, even if the software on the remote node is an older version.