SQL/MP Programming Manual for COBOL85
Dynamic SQL Operations
HP NonStop SQL/MP Programming Manual for COBOL85—429326-004
10-15
Defining Storage for Input and Output Parameters
Declaring the SQLDA Structure, Names Buffer, and Collation
Buffer
To declare an SQLDA structure and associated buffers, use the INCLUDE SQLDA
directive in the Data Division of your program (but not in a Declare Section). The
syntax is:
sqlda-name
is the name of the SQLDA structure; sqlda-name must follow the conventions for
COBOL names.
sqlvar-count
is either the maximum number of parameters (excluding indicator parameters) for
which you expect to receive input values or, for an output SQLDA, the maximum
number of output parameters. The default is 1. The COBOL85 compiler generates
a separate SQLVAR structure within the SQLDA for each parameter.
names-buffer
is the COBOL record name of the names buffer. The INCLUDE SQLDA directive
generates a template; for the names buffer you must declare your own template.
max-name-length
is the maximum number of bytes you expect in a parameter name to be returned in
a DESCRIBE or DESCRIBE INPUT statement. If you expect indicator parameters,
double the value of max-name-length.
release-option
specifies the version of the SQLDA structure generated by the COBOL85 compiler.
RELEASE1 specifies SQL/MP version 1, and RELEASE2 specifies SQL/MP
version 2.
INCLUDE SQLDA ( sqlda-name [, sqlvar-count ]
[, names-buffer, max-name-length ]
[, release-option ]
[, CPRULES collation-buffer, max-collation-size ]
)
Note. Although the COBOL85 compiler supports the RELEASE1 and RELEASE2 options,
HP might not support these options in a future PVU. If you are using a version 300 (or
later) COBOL85 compiler to generate version 1 or version 2 data structures, use the
INCLUDE STRUCTURES directive with the VERSION 1 or VERSION 2 option and remove
the RELEASE1 or RELEASE2 option from the INCLUDE SQLDA directive.