SQL/MP Version Management Guide

Program Versions
Compaq NonStop™ SQL/MP Version Management Guide429833-001
5-9
Retrieving SQL Program Versions
Program Versions in File Labels
The SQL/MP compiler stores the PFVs and PCVs in the SQL file labels of version 300
and newer programs and in the PROGRAMS table.
If the version information stored in a program’s file label is not consistent with the
version information stored in the PROGRAMCATALOGVERSION and
PROGRAMFORMATVERSION columns of the PROGRAMS catalog table, it is likely
that version errors will be returned.
The SQL VERIFY utility can ensure that version information in the file labels of
programs is consistent with the version information stored in the PROGRAMS catalog
table. If the PFV and PCV information stored in a program’s file label is not consistent
with the information stored in the PROGRAMS catalog, it might be necessary to drop
the program and recompile it.
For the syntax of the VERIFY utility, see the NonStop SQL/MP Reference Manual; for
information on using VERIFY, see the NonStop SQL/MP Installation and Management
Guide.
Retrieving SQL Program Versions
You can retrieve a program’s PFV and PCV in any of these ways:
By executing the GET VERSION OF PROGRAM statement
By executing the SQLCI FILEINFO command
By querying the PROGRAMS table of the catalog in which the program is
registered
By running the RESTORE utility with the DETAIL option specified to restore an
SQL program
Using the GET VERSION OF PROGRAM Statement
There are two forms of the GET VERSION OF PROGRAM statement. The GET
FORMAT VERSION OF PROGRAM statement returns a program’s PFV. The GET
CATALOG VERSION OF PROGRAM statement returns a program’s PCV.
(The GET VERSION OF PROGRAM statement can be used also to obtain the host
object SQL version, as explained under Retrieving the Host Object’s SQL Version
on
page 5-4.)
You can execute the GET VERSION OF PROGRAM statement in a static or dynamic
SQL program, or you can enter it as an SQLCI command.
The GET VERSION OF PROGRAM statement is not available in version 1 or version 2
SQL programs or in version 1 or version 2 SQLCI. You must enter the statement from a
node running version 300 or newer software. In a network, you can execute the GET
VERSION OF PROGRAM statement to retrieve the version of a program on a remote
node. If GET VERSION OF PROGRAM cannot determine the version of the program, a
zero value is returned.