Generating Structures With Different Versions; Checking The Version Of The C Compiler; Sharing Structures - HP NonStop SQL/MP Programming Manual

For c
Table of Contents

Advertisement

Error and Status Reporting
{ SQLCA | SQLSA } [ EXTERNAL ]
specifies that the structures are declared as external, making it possible to share
them among modules of an object file. No space is allocated for an external
SQLCA or SQLSA declaration. You must specify one occurrence of the formal
declaration of SQLCA and SQLSA somewhere in the program using the INCLUDE
SQLCA and INCLUDE SQLSA directive without the EXTERNAL option.

Generating Structures With Different Versions

You can generate SQL structures that are all of the same version or structures of
different versions. For example, to generate all version 300 structures in a program,
specify:
EXEC SQL INCLUDE STRUCTURES ALL VERSION 300;
Or, this directive generates different versions for each structure:
EXEC SQL INCLUDE STRUCTURES SQLCA VERSION 315

Checking the Version of the C Compiler

If you try to compile a C program that uses the INCLUDE STRUCTURES directive to
specify a later version of a structure than the C compiler can generate, the compiler
returns SQL error 11203. To determine the version of the C compiler before you
compile a program, run the VPROC program for the C compiler object file. Then, check
the version in the VPROC line that contains S7094, which is the SQL compiler
interface (SCI) product number.
When you compile the program, you can specify the SQLMAP option in the SQL
compiler directive. The SQLMAP option directs the C compiler to include the HOSV of
the C compiler in the map at the end of the source-file listing. For example, a
version 310 C compiler listing includes this line:
Host Object SQL Version = 310
For more information about versions of NonStop SQL/MP, see the SQL/MP Version
Management Guide.

Sharing Structures

Sharing a single SQLCA and SQLSA structure among modules of an object file saves
a large amount of memory space. The SQLCA structure is 430 bytes. The pre-R330
SQLSA structure is 838 bytes and the R330 SQLSA structure is 1790 bytes. An object
file with many modules that contain embedded SQL can consume an enormous
amount of memory space for multiple structures alone.
HP NonStop SQL/MP Programming Manual for C—429847-008
Generating Structures With Different Versions
SQLDA VERSION 2
SQLSA VERSION CURRENT;
9-3

Advertisement

Table of Contents
loading

Table of Contents