NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
G-4
GET VERSION OF PROGRAM Statement
The following static SQL statement from a C, Pascal, or TAL program retrieves the
version of table mytable and stores it in hostvar1:
EXEC SQL GET VERSION OF TABLE mytable INTO :hostvar1;
The following static SQL statement from a COBOL85 program retrieves the version
of index IDX2 and stores it in hostvar2:
EXEC SQL GET VERSION OF INDEX idx2 INTO :hostvar2;
The following COBOL85 example uses dynamic SQL to retrieve the version of
catalog \sysa.$vol1.mycat and store it in an SQLDA:
MOVE "GET VERSION OF CATALOG \sysa.$vol1.mycat" TO string1.
EXEC SQL PREPARE s1 FROM :string1 END-EXEC.
EXEC SQL EXECUTE s1
RETURNING USING DESCRIPTOR :mysqlda END-EXEC.
GET VERSION OF PROGRAM Statement
GET VERSION OF PROGRAM is a DSL statement that returns the program catalog
version (PCV), program format version (PFV), or host object SQL version (HOSV) of
an SQL program that is registered in an SQL catalog.
{ CATALOG | FORMAT | HOST OBJECT }
specifies the type of program version to return: PCV (CATALOG), PFV
(FORMAT), or HOSV (HOST OBJECT).
program
is the Guardian name of the program for which to return a version. (If the program is
an SQL program in an OSS file, program must be the Guardian-format ZYQ name
of the program file, not the pathname.)
For a CATALOG or FORMAT version, program must be an existing program that
has been SQL-compiled. For a HOST OBJECT version, program must be an
existing program that has been host language-compiled (and may have been SQL-
compiled).
INTO :var
(static SQL programs only) specifies a host variable in which to return the version
number.
Considerations—GET VERSION OF PROGRAM
Use in host language programs
GET { CATALOG | FORMAT | HOST OBJECT }
VERSION OF PROGRAM program [ INTO :var ]