SQL/MP Version Management Guide

Program Versions
Compaq NonStop™ SQL/MP Version Management Guide429833-001
5-6
Program Catalog Version (PCV)
The format version of a program must be the same as or newer than the version of
any object referred to by the program.
The format version of a program has no relation to the version of the catalog in
which the program is registered.
A program cannot refer to any object with a version newer than the program’s format
version. This is true even if the program refers only to older-version features of an
object.
The relationship of program format version to object version is listed as:
The format version of a program can be older than, the same as, or newer than the
version of the catalog in which it is registered. For example, suppose you recompile an
existing version 2 program with a version 315 SQL compiler, raising its format version
to 315. The program can still be registered in a version 1, version 2, version 300, or
version 310 catalog, in addition to a version 315 catalog.
Program Catalog Version (PCV)
The program catalog version number is a number that specifies the minimum version of
the newest SQL/MP feature used in a program. When an SQL-compiled program uses a
feature with a newer version than the current program catalog version, the SQL compiler
raises the program’s PCV to match the version number of the new feature.
As a corollary, the program catalog version specifies the oldest-version program catalog
in which a program can be registered.
For example, in version 300 of SQL software, the COLLATE clause is a feature that
affects the program catalog version. When version 300 software is running and the
program catalog version is set to 1, a program can raise the program catalog version to
300 by using a COLLATE clause in a static SQL statement. Subsequently, the program
must be successfully SQL-compiled.
No features in a version 2 program can affect the program catalog version; as a result,
the catalog version of a program can be 1 or it can be 300 or newer, but it cannot be 2.
A feature of a SQL/MP version does not affect a program’s PCV unless the feature is
explicitly named in an SQL statement. For example, suppose a program executes the
following SQL statement, which then successfully compiles:
EXEC SQL
SELECT COLUMNA COLLATE FRENCH FROM TABLET
sql-terminator
Program Format
Version Object Version
0 1 or 2
300 1, 2, or 300
310 1, 2, 300, or 310
315 1, 2, 300, or 310