SQL/MP Version Management Guide
Database Versions
Compaq NonStop™ SQL/MP Version Management Guide—429833-001
3-10
Initializing Object Versions
For example, a collation is at least a version 300 object. Therefore, collations are
supported only by software of version 300 or newer. A column with null values is a
version 2 feature, so a column with null values is supported by version 2 or newer
versions of the software.
Initializing Object Versions
When an SQL object is created, its version is initialized. Different SQL statements are
used to create different kinds of objects, and the statements used to create particular
objects affect the version numbers of the objects.
Statements that create objects affect object version numbers as follows:
•
CREATE TABLE. When this statement is used to create a table, the version of the
table corresponds to the set of features used by the table.
If you create a table using CREATE TABLE LIKE, the version of the new table
depends on which features are inherited from the source table and which additional
features are specified for the new table. You can create a new table that has an older
version than its source table if new features of the source table are not copied.
For example, suppose you copy a version 2 table whose only version 2 feature is
help text. Also suppose, however, that you omit the WITH HELP TEXT clause
when you create the new table. In this case, the new table is a version 1 table.
You can also create a table with a newer version than its source table. For example,
if you copy a version 1 table and specify NO AUDITCOMPRESS, the created table
is a version 2 table.
•
CREATE INDEX. When this statement is executed to create an index, the version of
the new index corresponds to the set of features used in the index. If the version of
the new index is newer than the version of its base table, the version of the base
table is raised to match the version of the new index. The version of any views that
depend on the table are also raised automatically to the newer version.
For example, suppose you have a version 2 table, and you create an index on a
character column specifying a collation. The index is version 300 (or newer), and
the table version is raised to version 300 (or newer).
•
CREATE VIEW. When this statement is executed to create a view, the version of
the view corresponds to the set of features selected for the view from its underlying
tables. The version of a view is always the same as or newer than the version of its
underlying tables.
For example, suppose you have a version 2 table, and you create a view that refers
to a collation in the WHERE clause. The table’s version remains version 2, but the
view’s version is raised to at least 300 to match the version of the collation.
•
CREATE COLLATION. This statement records the version of the collation in two
locations in the catalog for the new collation: the version of features used in the
collation source file and the version of the collation as an SQL object. Currently all
version numbers relating to collations are 300. The version of the collation as an
SQL object is also recorded in its file label. The collation’s object version affects the
version of any index, table, or view that refers to the collation.