SQL/MP Programming Manual for COBOL

Converting COBOL Programs
HP NonStop SQL/MP Programming Manual for COBOL529758-003
D-6
Generating a Version 1 SQLDA Structure
Example D-2 shows a version 1 SQLDA structure.
Table D-3 describes each field in a version 1 SQLDA structure.
Example D-2. Version 1 SQLDA Structure
01 sqlda-name.
05 EYE–CATCHER PIC X(2) VALUE "DA".
05 NUM–ENTRIES PIC S9(4) COMP.
05 SQLVAR [ –R1 ] OCCURS sqlvar-count TIMES.
10 DATA–TYPE PIC S9(4) COMP.
10 DATA–LEN NATIVE–2.
10 RESERVED–0 PIC S9(4) COMP.
10 VAR–PTR PIC S9(9) COMP.
10 RESERVED PIC S9(9) COMP.
01 names-buffer-name PIC X( length ).
Table D-3. Version 1 SQLDA Structure Fields (page 1 of 2)
Field Name Description
EYE-CATCHER An identifying field that a 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 parameters or output variables 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.