SQL/MP Version Management Guide

Version Compatibility for SQL Programs
Compaq NonStop™ SQL/MP Version Management Guide429833-001
7-2
RELEASE1 and RELEASE2 Options in Older
Version Programs
When a version 1 dynamic SQL program is executed or compiled on a node running
version 300 or newer SQL/MP software, the execution or compilation can fail also if the
program’s source code checks for a NULLP (null pointer) in the VAR-PTR field of the
SQLDA data structure.
In version 1 of SQL, NULLP is returned in the VAR-PTR field of the SQLDA data
structure when the names buffer is too small. In version 2 and newer versions of SQL, a
negative value is returned in VAR-PTR. If a null value is allowed in the VAR-PTR field,
NULL-INFO-SQLDA is set to minus one (-1), and the new field IND-PTR points to the
extended address of a NULL indicator value.
RELEASE1 and RELEASE2 Options in Older Version Programs
When you host-compile a version 1 or version 2 SQL program on a node running
version 1 or version 2 software, check to see if RELEASE1 and RELEASE2 options in
the program’s source code are used.
You can disregard both these options when you host-compile a version 300 or newer
SQL program on a node running version 300 or newer SQL software. Currently, an SQL
program that includes either option compiles and executes correctly on a node running
version 300 or newer software.
It is important to note, however, that support for the RELEASE1 and RELEASE2
options is expected to be phased out in a future release of SQL/MP software. The
INCLUDE STRUCTURES directive will continue to be supported, however, and is now
the recommended alternative to the RELEASE1 and RELEASE2 options in new SQL
programs.
The RELEASE1 and RELEASE2 options were introduced in version 2. These options
are specified with either the SQL directive (the SQL pragma in C) or the INCLUDE
SQLDA directive.
In version 2, these two options are used to distinguish between version 1 and version 2
of the SQLDA data structure. A distinction must be made because version 2 of the
SQLDA structure contains additional fields that require initialization.
The version 2 SQL compiler uses the RELEASE1 and RELEASE2 options to determine
which version of the SQLDA data structure to compile with a dynamic SQL program.
A version 1 or version 2 SQL executor can execute an SQL program compiled with the
RELEASE1 option. However, only a version 2 SQL executor can successfully execute
an SQL program compiled with the RELEASE 2 option. (A RELEASE1 or RELEASE2
option specified with INCLUDE SQLDA overrides a RELEASE1 or RELEASE2 option
specified with the SQL directive or pragma.)
For more information on the differences between the SQL data structures in different
versions of SQL/MP, see Appendix A, Summary of Feature, Catalog, and Data Structure
Changes.