SQL/MP Programming Manual for COBOL

Dynamic SQL Operations
HP NonStop SQL/MP Programming Manual for COBOL529758-003
10-16
Defining Storage for Input and Output Parameters
release-option
specifies the version of the SQLDA structure generated by the HP COBOL
compiler. RELEASE1 specifies SQL/MP version 1, and RELEASE2 specifies
SQL/MP version 2.
CPRULES
is a keyword that is required if you specify a collation buffer.
collation-buffer
is a host variable that is a COBOL record name of the collation buffer. The
DESCRIBE statement includes the COLLATIONS INTO clause, which directs
SQL/MP to return collations to collation-buffer.
For more information, see Calculating the Lengths of the Names and Collation
Buffers on page 10-20.
max-collation-size
is the maximum number of bytes you expect for any one collation.
Considerations
These guidelines apply to the use of the INCLUDE SQLDA directive:
You must supply both the number of parameters you expect as well as the
maximum lengths of their names. Be sure to specify sufficient numbers and sizes.
You can specify large numbers to ensure that any data you might obtain at run time
will fit. If you are not concerned about memory use, this approach is most efficient.
Declare buffers in working storage. Use redefines to store differing data types.
One reason to specify a collation buffer is to access collation rules in your COBOL
code so that you can make comparisons using the same rules that SQL/MP does
for a given column.
Examples
In this example, the INCLUDE SQLDA directive generates a version 300 SQLDA
structure named SQLDAX with these buffers:
NAMES-BUFFER, which reserves space for 20 names with a maximum length of
30 bytes each
Note. Although the HP COBOL 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) HP COBOL 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.