SQL/MP Version Management Guide
Program Versions
Compaq NonStop™ SQL/MP Version Management Guide—429833-001
5-7
Where SQL Program Versions Are Stored
This statement explicitly has a COLLATE clause. Because the COLLATE clause first
appeared in SQL version 300, the successful compilation of the statement sets the
program catalog version to 300.
In contrast, the following SQL statement refers to a column, COLUMNA, which
includes a COLLATE clause in its definition. However, the statement itself does not
include the COLLATE clause:
EXEC SQL
SELECT COLUMNA FROM TABLET
sql-terminator
In this case, the program catalog version is not set to 300. If the program catalog version
is 1 before the above statement is executed, it remains 1 because the statement does not
explicitly specify a COLLATE clause.
The rules determining the relationship of program catalog versions to database versions
are:
•
The catalog version of a program must be the same as or older than the version of
the catalog in which the program is registered.
•
The catalog version of a program has no relation to the versions of objects that the
program refers to.
A program cannot be registered in a catalog whose version is older than the catalog
version of the program. For example, if you add an explicit COLLATE clause to a
program, the catalog version of the program becomes 300, and the program can be
registered only in a version 300 catalog. Subsequently, if you attempt to compile the
program and register it in a version 1 or version 2 catalog, SQL compilation fails.
In summary, the relationship of program catalog version to catalog version is:
The catalog version of a program is not required to match the versions of objects the
program refers to. For example, a program with a catalog version of 1 can access a
version 300 object, such as a table containing a column defined with a collation.
Where SQL Program Versions Are Stored
The SQL compiler stores every program’s PFV and PCV in the user catalog in which
the SQL program is registered and also in the file label of the program.
Program Catalog Version Catalog Version
1 1, 2, 300, 310, or 315
300 300, 310, or 315
310 310 or 315
315 315