SQL/MP Version Management Guide
Version Compatibility for SQL Programs
Compaq NonStop™ SQL/MP Version Management Guide—429833-001
7-4
Version Independent SQL Data Structures
•
Replace SQLGETCATALOGVERSION procedures with GET VERSION OF
CATALOG statements.
•
Replace SQLGETSYSTEMVERSION procedures with GET VERSION OF
SYSTEM statements.
In existing version 1 or version 2 programs that contain RELEASE compiler options,
remove the RELEASE options and replace them with INCLUDE STRUCTURES
directives. The INCLUDE STRUCTURES directive ensures that your program,
whatever its version, uses the correct version of the included SQL data structures.
Also, check that you place an INCLUDE STRUCTURES directive in your code before
you use any version 300 or newer SQL data structure. Follow the rules for version
management of SQL data structures described under Version Independent SQL Data
Structures.
Version Independent SQL Data Structures
The version numbers of the SQL/MP data structures (SQLCA, SQLSA, and SQLDA)
change with each new version of SQL/MP. However, changes in the version numbers of
these data structures do not affect programs developed to run under version 300 or
newer SQL/MP software.
When a program is written correctly for version 300 or newer SQL/MP, the program can
contain any version of any SQL data structure. (The only exceptions to this rule are
programs that contain RELEASE1 or RELEASE2 options; for details on this topic, see
RELEASE1 and RELEASE2 Options in Older Version Programs
on page 7-2.)
Converting Programs to Use New Versions of SQL Data Structures
When the version number of an SQL data structure changes, the new version sometimes
contains features that were not available in previous versions. To incorporate these new
features into existing programs, you must modify and recompile the programs.
For example, collations and multibyte character sets are version 300 features supported
only by version 300 and newer data structures. To make use of these features in existing
programs, you must modify the programs to use version 300 or newer data structures.
To upgrade a program to use features supported by version 300 or newer SQL data
structures:
•
Use the INCLUDE STRUCTURES directive in your program to specify the version
of the data structures you want your program to contain. The simplest technique is to
assume you need all three types of data structures and to use the INCLUDE
STRUCTURES ALL VERSION 300 (or newer) directive in your program.
•
Place an INCLUDE directive in your program for each of the three SQL data
structures: INCLUDE SQLCA, INCLUDE SQLDA, and INCLUDE SQLSA.
Currently, it is not necessary for programs to contain a version 300 (or newer)
SQLCA. However, specifying at least a version 300 SQLCA structure prepares your
program for possible future changes to the SQLCA.