SQL/MP Programming Manual for C
HP NonStop SQL/MP Programming Manual for C—429847-008
D-1
D Converting C Programs
A C program developed for NonStop SQL/MP version 1 or version 2 software can run 
on SQL/MP version 300 (or later) software without any changes to its embedded SQL 
statements or directives. However, to use new SQL features, you must modify and 
recompile the program. 
Topics include:
Generating SQL Data Structures
Generating SQLDA Structures on page D-2
Planning for Future PVUs on page D-8
Generating SQL Data Structures
The SQLCA, SQLSA, and SQLDA data structures can change in future PVUs of 
NonStop SQL/MP. Follow these guidelines if you are converting an existing C program 
(that is, a program that uses version 1 or version 2 structures) or writing a new 
program to use version 300 (or later) SQL structures: 
Use the INCLUDE STRUCTURES directive to specify the version of the SQL 
structures, even if you require version 1 or version 2 structures. To generate 
version 300 or later structures, you must use the INCLUDE STRUCTURES 
directive. For more information, see Section 9, Error and Status Reporting
.
If you allocate SQL data structures at run time, use the compiler-generated length 
identifiers (for example, SQLSA_LEN for the length of an SQLSA structure) to 
specify the memory to allocate. (In some cases, you can also use a C function to 
generate the length of a structure.) Using the compiler-generated length identifiers 
can reduce the impact on a program if the size of an SQL data structure changes 
in a future PVU. 
Use the system-generated eye-catcher identifiers to initialize the eye-catcher 
fields. Do not hard code eye-catcher values or write code that depends on 
hard-coded values. The eye-catcher values can change in a new PVU. 
Use the SQLCAGETINFOLIST procedure to return information from the SQLCA 
structure. Do not access this structure directly. HP reserves the right to change the 
SQLCA structure in future PVUs. 
Note. A D20 (or later) C compiler requires that a C program comply to the ISO/ANSI C 
standard. For information about converting a program to follow this standard, see the C/C++ 
Programmer’s Guide. 
Also, a C-series program can run at a low PIN on a D-series system without any changes. 
However, for a C-series program to use D-series features (for example, to run at a high PIN), 
you might need to convert certain parts of the program. For information about converting a 
C-series program to use D-series features, see the Guardian Application Conversion Guide. 










