NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
G-3
Considerations—GET VERSION
CATALOG, COLLATION, INDEX, TABLE, VIEW, or SYSTEM
specifies the type of item for which to return the version.
name
is the name of the item for which to return the version.
For type CATALOG, name must be a catalog name or a DEFINE of class
CATALOG. For type SYSTEM, name is optional (the default is the local node) but
must be a node name with a leading “\” if specified. For all other types name must
be a Guardian name (or an equivalent DEFINE).
INTO :var
(static SQL programs only) specifies a host variable in which to return the version.
Considerations—GET VERSION
Use in host language programs
In programs, GET VERSION returns an integer value. The variable to receive the
value must be compatible with the SQL data type UNSIGNED SMALLINT.
For static SQL, specify the variable in the INTO clause of GET VERSION. For
dynamic SQL, specify the variable in the RETURNING clause of the EXECUTE or
specify an output SQLDA in the RETURNING USING DESCRIPTOR clause of the
EXECUTE. (You cannot use GET VERSION with EXECUTE IMMEDIATE.)
GET VERSION also sets SQLCODE to report status and fills in the SQLCA. GET
VERSION has no EXPLAIN output.
Examples—GET VERSION
The following SQLCI example retrieves the version of table mytable:
GET VERSION OF TABLE mytable;
VERSION: 1
--- SQL operation complete.
The following SQLCI example retrieves the version of catalog mycat:
GET VERSION OF CATALOG mycat;
VERSION: 300
--- SQL operation complete.
The following SQLCI example retrieves the version of index myindx:
GET VERSION OF INDEX myindx;
VERSION: 315
---SQL operation complete.