SQL/MP Programming Manual for COBOL

Error and Status Reporting
HP NonStop SQL/MP Programming Manual for COBOL529758-003
9-21
Returning Performance and Statistics Information
If you route errors directly to HOMETERM by using the SQLCA_DISPLAY2_
routine, save the errors in an SQL error table also. This table can be used as an
easily retrievable record of errors.
Archive the error table. Using the SQL utilities, make a copy of the table and purge
the current data. Retain the copy for future reference. The error table might also be
useful for reporting errors to your service provider.
Distinguish between true errors, such as file-system errors, and anticipated errors,
such as an attempt to insert a duplicate row.
Save all errors, including anticipated errors, in the development routines.
Save only selected (true) errors in the production routines.
Consider establishing a help desk to assist end users in resolving errors. A help
desk staff can query the error table to determine which error is associated with
which user. In some situations, an end user might query the table directly if the
user has access to SQLCI and the data is understandable.
A database administrator might also want to query the table for other errors such
as file-system errors (SQL error 8300).
A database administrator might generate reports to answer these questions:
How many errors occurred today?
How often does a user or group of users violate constraints?
How often does a user or group of users attempt to insert duplicate rows?
Returning Performance and Statistics
Information
SQL/MP returns performance and statistics information to the SQL statistics area
(SQLSA) after the execution of these DML statements:
An INSERT, UPDATE, and DELETE statement
A SELECT statement with the INTO clause for a host variable
An OPEN, CLOSE, or FETCH statement for a cursor operation that has a SELECT
statement specified in the DECLARE CURSOR statement
For dynamic SQL operations, SQL/MP returns information in the SQLSA structure for
these statements:
Each PREPARE statement, which includes information about input parameters,
output columns, and the length of the input and output names buffer
Each DESCRIBE statement, including information about input parameters, output
columns, the names buffer, and the collation buffer
Each DESCRIBE INPUT statement, including information about input parameters,
output columns, and the names buffer