SQL/MP Programming Manual for COBOL85
Converting COBOL Programs
HP NonStop SQL/MP Programming Manual for COBOL85—429326-004
D-3
Generating a Version 2 SQLDA Structure
3. If you are converting a version 1 SQLDA structure, initialize the NULL-INFO and
IND-PTR fields. (Your program should already initialize these fields for a version 2
SQLDA structure.)
4. Add an INCLUDE STRUCTURES directive with the ALL VERSION 2 option:
EXEC SQL INCLUDE STRUCTURES ALL VERSION 2 END-EXEC.
Or specify only the SQLDA VERSION 2 option:
EXEC SQL INCLUDE STRUCTURES SQLDA VERSION 2 END-EXEC.
Example D-1 shows a version 2 SQLDA structure.
Table D-2 describes each field in a version 2 SQLDA structure.
Example D-1. Version 2 SQLDA Structure
01 sqlda-name.
05 EYE–CATCHER PIC X(2) VALUE "D1".
05 NUM–ENTRIES PIC S9(4) COMP VALUE sqlvar-count.
05 SQLVAR [ –R2 ] OCCURS sqlvar-count TIMES.
10 DATA–TYPE PIC S9(4) COMP.
10 DATA–LEN NATIVE–2.
10 PRECISION PIC S9(4) COMP.
10 NULL–INFO PIC S9(4) COMP..
10 VAR–PTR PIC S9(9) COMP.
10 IND–PTR PIC S9(9) COMP.
10 RESERVED PIC S9(18) COMP.
01 names-buffer-name PIC X( length ).
Table D-2. Version 2 SQLDA Structure Fields (page 1 of 3)
Field Name Description
EYE-CATCHER An identifying field your program must initialize as D1 for version 1 or DA
for version 2. SQL/MP statements do not return values to EYE-
CATCHER.
NUM-ENTRIES The number of input or output parameters the SQLDA structure can
accommodate.
SQLVAR Group item that describes input parameters or database columns. The
DESCRIBE INPUT and DESCRIBE statements return one SQLVAR entry
for each input parameter or each output variable.
DATA-TYPE The data type of the parameter or output variable.