SQL/MP Programming Manual for COBOL

HP NonStop SQL/MP Programming Manual for COBOL529758-003
9-1
9 Error and Status Reporting
This section provides information about error and status reporting after the execution of
an SQL statement or directive in a COBOL program. For information about the SQL
descriptor area (SQLDA), see Section 10, Dynamic SQL Operations.
Topics include:
Using the INCLUDE STRUCTURES Directive
Returning Error and Warning Information on page 9-4
Returning Performance and Statistics Information on page 9-21
Using the INCLUDE STRUCTURES Directive
The INCLUDE STRUCTURES directive specifies the version of SQL structures that the
HP COBOL compiler generates. You must specify the INCLUDE STRUCTURES
directive to generate version 300 or later SQL data structures. If you omit this directive,
the HP COBOL compiler generates version 2 structures by default and includes this
informational message in the compilation summary:
INCLUDE STRUCTURES directive for SQL is missing. SQL
VERSION 2 is assumed. This may produce incorrect SQL
results in programs which use features introduced
in SQL versions greater than VERSION 2.
Code the INCLUDE STRUCTURES directive in the declarations area of the procedure
before you code an INCLUDE SQLCA, INCLUDE SQLSA, or INCLUDE SQLDA
directive. If the procedure is part of a compilation unit that consists of more than one
procedure, place the INCLUDE STRUCTURES directive in the global declarations area
or in the declarations area of the first procedure. The directive then applies to all
procedures in the compilation unit.
Use this syntax for the INCLUDE STRUCTURES directive:
ALL VERSION
are keywords that specify the same version for all three SQL structures (SQLCA,
SQLSA, and SQLDA).
INCLUDE STRUCTURES { structure-spec }
structure-spec is:
{ [ ALL ] VERSION version }
{ { SQLCA | SQLSA | SQLDA } VERSION version }...
{ { SQLCA | SQLSA } [ EXTERNAL ] }