SQL/MP Version Management Guide
Database Versions
Compaq NonStop™ SQL/MP Version Management Guide—429833-001
3-7
Retrieving Catalog Versions
For a description of the attributes of these columns, see the NonStop SQL/MP Reference
Manual.
In version 300 and newer catalogs, the version information in the VERSIONS table of a
user catalog and the CATALOGS table of the system catalog are consistent. Similarly,
for version 1 and 2 catalogs, the version information is consistent in both the
VERSIONS and CATALOGS tables.
Retrieving Catalog Versions
You can retrieve the catalog versions in any of these ways:
•
By executing the GET VERSION OF CATALOG statement
•
By querying either the system catalog CATALOGS table or the user catalog
VERSIONS table
•
By calling the SQLGETCATALOGVERSION procedure (a method that will be
phased out in a future release of SQL/MP)
Before you can retrieve the version of a system catalog, you must know the name of the
catalog. You can retrieve the name of a local or remote system catalog by executing the
GET CATALOG OF SYSTEM statement.
Using the GET VERSION OF CATALOG Statement
GET VERSION OF CATALOG is a DSL (Data Status Language) statement that returns
the catalog version of any SQL/MP catalog. (For more information about DSL
statements, see the NonStop SQL/MP Reference Manual.)
You can execute the GET VERSION OF CATALOG statement in a static or dynamic
SQL program, or you can enter it as an SQLCI command interface.
The GET VERSION OF CATALOG statement is not available in version 1 or version 2
SQL/MP software. You must execute the statement from a node running version 300 or
newer software. In a network, you can execute the GET VERSION OF CATALOG
statement to retrieve the version of a catalog on a remote node, even if the software on
the remote node is an older version.
For example, suppose you are running version 315 SQLCI on a node named \SYS2,
which is running version 315 SQL/MP software. To determine the version of the user
catalog $VOL1.SALES on the remote node \SYS1, type this SQLCI command:
>> GET VERSION OF CATALOG \SYS1.$VOL1.SALES;
SQLCI returns:
VERSION: 2
--- SQL operation complete.
GET VERSION OF CATALOG does not return the catalog format version. To obtain
the catalog format version, you must query the catalog tables.
You cannot issue the EXECUTE IMMEDIATE statement with the GET VERSION OF
CATALOG statement.