SQL/MX 2.x Database and Application Migration Guide (G06.23+, H06.04+, J06.03+)

Version Management and Interoperability
HP NonStop SQL/MX Database and Application Migration Guide540435-005
2-11
SQL/MX Database Object Versions
NonStop SQL/MX can also obtain the object schema versions (OSVs) of SQL/MX
database objects on which the system software operates. NonStop SQL/MX uses the
OSVs to perform version checking. For example, when an object is opened, the
SQL/MX executor compares the OSV for that object with the earliest supported
schema version. If the object’s OSV is earlier than the earliest supported schema
version, a versioning error is generated. For more information, see SQL/MX Database
Object Versions on page 2-11.
SQL/MX Database Object Versions
Database object versioning is a set of mechanisms that allow SQL/MX software to
determine if the version of an SQL/MX database object is compatible with the MXV.
Database object versions include the schema version, object schema version (OSV),
and object feature version (OFV).
Schema Version and Object Schema Version (OSV)
A schema version is assigned to each user schema at creation time and is based on
the version of the SQL/MX compiler that creates the schema. The object schema
version (OSV) of an SQL/MX database object is inherited from the schema where the
object resides and determines if the object can be accessed by a particular version of
NonStop SQL/MX.
NonStop SQL/MX uses the earliest supported schema version of the node to
determine if it can access an SQL/MX database object in a schema that has a lower
version. If the object’s OSV is higher than or equal to the earliest supported schema
version and lower than or equal to the MXV (which is often the same as the current
schema version) of the node, NonStop SQL/MX accesses the object. Otherwise,
NonStop SQL/MX returns a versioning error.
Displaying the OSV
This example displays the object schema version (OSV) of a specified schema, where
node, catalog, and schema are names that you provide:
select s.schema_version
from nonstop_sqlmx_node.system_schema.schemata s,
nonstop_sqlmx_node.system_schema.catsys c
where c.cat_name = 'catalog'
and c.cat_uid = s.cat_uid
and s.schema_name = 'schema';
SCHEMA_VERSION
--------------
1200
--- 1 row(s) selected.
>>