SQL/MP Version Management Guide
Version Compatibility for SQL Programs
Compaq NonStop™ SQL/MP Version Management Guide—429833-001
7-7
SQL Compilation for Version Independence
•
If you change the version of an SQL data structure, you must recompile all the
modules that declare the structure as an external structure. Otherwise, run-time
version errors can result.
SQL Compilation for Version Independence
When you develop an SQL program that is to be executed on nodes running different
versions of SQL/MP software, you must SQL compile the program separately on each
node. When you want to run an existing SQL program on nodes running different
versions of SQL/MP software, the same rule applies.
To move an existing SQL program from one node to another, use the DUP utility or the
RESTORE utility. The program that has been moved must be recompiled by using the
SQL compiler on the node where it is to execute.
When an existing SQL program is moved to another node and is then recompiled, its
SQL compilation fails if it was originally host-compiled on a host language compiler
whose SQL version is newer than the version of the SQL compiler on its new node.
For example, if you attempt to use a version 2 SQL compiler to SQL-compile a program
and the program was originally host-compiled on a compiler whose SQL version is 300
or newer, SQL/MP returns a version error.
Host Language Compilation for Version Independence
When you design a new program to execute in a mixed version network whose nodes
are running different versions of SQL/MP software, you can host-compile the program
in either of two ways:
•
Host-compile the source program on a host language compiler whose SQL version
matches the oldest version software in the network.
For example, if you want your program to run on nodes running version 1, version
2, and version 315 software, host-compile the program on a host language compiler
whose SQL version is 1. The program can then be distributed to each of the nodes
for SQL compilation. This method gives you central control over compilation and
does not require you to SQL-license multiple host compilers.
•
Host-compile your source program separately on each node where it will execute.
When you use this method, you can be sure you are host-compiling your program on
a compiler whose version matches the version of the SQL/MP software it requires:
that is, the version of SQL software running on the node where your program will be
SQL-compiled and executed.
SQL Compilation in a Mixed Version Network
These are the basic rules of version management for SQL compilation in a mixed
version network: