SQL/MP Version Management Guide
Program Versions
Compaq NonStop™ SQL/MP Version Management Guide—429833-001
5-13
SQL Data Structure Version Assignment
Because the versions of the SQL data structures can change, programs must have access
to the versions of the SQL data structures they are designed to use. The INCLUDE
STRUCTURES directive can help check that your programs meet this requirement.
With the INCLUDE STRUCTURES directive, a program can inform the host language
compiler of the SQL data-structure versions it requires.
For an explanation of how to write programs that ensure data-structure compatibility, see
Section 7, Version Compatibility for SQL Programs
.
For more information about the SQL data structures, see the NonStop SQL/MP
Programming Manual for the programming language you are using.
SQL Data Structure Version Assignment
As noted previously, when a new version of SQL/MP software is released, a new
version of the SQL data structures is released to match the new version of the software.
In turn, the version assigned to each SQL data structure determines the values of the
eye-catcher and length literals associated with the data structure. (An eye-catcher literal
is a string that identifies the data structure; the length literal provides the length of the
data structure.)
Although the version number of the three SQL data structures changes with each new
software version, the formats of the three data structures (SQLCA, SQLSA, and
SQLDA) can remain the same.
For example, the SQLCA and SQLSA structures are identical in versions 1 and 2. The
formats of the SQLSA and SQLDA structures changed from version 2 to version 300,
but the SQLCA format did not. Furthermore, the formats of the SQLSA, SQLDA, and
SQLCA structures did not change from version 300 to version 310 or from version 310
to version 315.
Similarly, the eye-catcher value does not necessarily change each time the data structure
changes or each time the version changes. For example, the eye-catcher value for a
version 2 SQLDA and a version 300 SQLDA is the same, although the structures differ.
Using INCLUDE SQLCA, INCLUDE SQLSA, and INCLUDE
SQLDA Directives
As noted earlier in this section, host language compilers generate the SQL data
structures required by SQL elements embedded in programs. Every SQL program
requires an SQLCA data structure, and most SQL programs require the SQLSA data
structure. Only dynamically compiled programs require the SQLDA data structure.
To ensure that a host language compiler generates the particular data structures that a
source program requires, place the INCLUDE SQLCA, INCLUDE SQLSA, and
INCLUDE SQLDA directives in the source program, as explained next under Using the
INCLUDE STRUCTURES Directive.
Using the INCLUDE STRUCTURES Directive
Host language compilers also determine which versions of the SQL data structures to
generate. To ensure that a host language compiler generates the correct versions of the