SQL/MP Programming Manual for C

Converting C Programs
HP NonStop SQL/MP Programming Manual for C429847-008
D-7
Generating a Version 1 SQLDA Structure
Using a Combination of SQLDA Structures
Version 300 (or later) SQL/MP software does not support different versions of SQLDA
structures in the same compilation unit. If a program requires more than one SQLDA
structure in a compilation unit, convert all SQLDA structures to version 315. However,
to use a combination of SQLDA structures (for example, a version 2 structure and a
version 315 structure), follow these steps:
1. Separate the program into different compilation units so that the version 315
SQLDA structure and the supporting executable statements are in a different
compilation unit than the version 2 (or version 1) SQLDA structure and its
executable statements.
2. Specify an INCLUDE STRUCTURES directive with the appropriate VERSION
clause in each compilation unit.
3. Compile each compilation unit separately.
4. Use the Binder program to combine the object files into a single target object file.
data_type
Data type of the parameter or output variable. For the table of data type
values, see Section 10, Dynamic SQL Operations
.
data_len
data_len depends on the data type:
Fixed-length character Number of bytes in the string.
Variable-length character Maximum number of bytes in the string.
Decimal numeric Bits 0:7 contain the decimal scale.
Bits 8:15 contain the byte length of the item.
Binary numeric Bits 0:7 contain the decimal scale.
Bits 8:15 contain the byte length of the item
(2, 4, or 8).
Date-time or INTERVAL Bits 0:7 contain a value specifying the range of
date-time fields. For the table of values, see
Section 10, Dynamic SQL Operations
.
Bits 8:15 contain the storage size of the item.
var_ptr
Extended address of the actual data (value of input parameter or
column). NonStop SQL/MP does not return var_ptr; a program must
initialize var_ptr to point to the input and output data buffers.
Table D-3. Version 1 SQLDA Structure Fields (page 2 of 2)
Field Name Description