SQL/MP Version Management Guide
Program Versions
Compaq NonStop™ SQL/MP Version Management Guide—429833-001
5-14
SQL Data Structure Version Assignment
data structures that a source program requires, place the INCLUDE STRUCTURES
directive in the source program. When the host language compiler compiles your
program, it generates the data structure versions specified in the INCLUDE
STRUCTURES directive.
The INCLUDE STRUCTURES directive is not available to version 1 and version 2 SQL
programs. Therefore, when a host language compiler compiles a version 1 or a version 2
SQL program, it generates SQL data structures with a default version of 2. Host
language compilers also assign a default data-structure version of 2 when a program has
a PFV of 300 or newer and does not contain an INCLUDE STRUCTURES directive.
To ensure version compatibility, every module of a program with a format version of
300 or newer should contain an INCLUDE STRUCTURES directive if it contains an
INCLUDE SQLCA, INCLUDE SQLSA, or INCLUDE SQLDA directive. If you omit
the INCLUDE STRUCTURES directive in such a program, the data structure version
defaults to 2, and the host language compiler issues a warning message in its
compilation summary. The message warns that the structure might produce incorrect
results during program execution.
When you upgrade to a new version of SQL/MP, you might want to continue to use
existing programs that contain code to access older-version data structures. By invoking
the INCLUDE STRUCTURES directive, you can continue using older-version data
structures even after you upgrade to a new version of SQL/MP.
For example, if you want to continue to access version 2 SQLDA and SQLSA data
structures in a version 300 or newer program, place the following directive in the
program:
EXEC SQL
INCLUDE STRUCTURES SQLDA VERSION 2 SQLSA VERSION 2
sql-terminator
Later, if you decide to convert your program to use newer-version data structures, you
can generate data structures for version 300 or newer by executing the INCLUDE
STRUCTURES directive again:
EXEC SQL
INCLUDE STRUCTURES ALL VERSION 300
sql-terminator
You can specify individual data structures in the INCLUDE STRUCTURES directive,
but the ALL option ensures future compatibility.
For information about the syntax of the INCLUDE STRUCTURES directive and for
examples and usage guidelines, see the NonStop SQL/MP Reference Manual. For
information about the content of each data structure and for more details on using the
structures in your program, see the NonStop SQL/MP Programming Manual for the
language you are using.
Note. The INCLUDE STRUCTURES directive replaces the RELEASE1 and RELEASE2
options of the INCLUDE SQLDA and SQL directives available to version 2 SQL programs.