SQL/MP Programming Manual for COBOL

SQL/MP System Procedures
HP NonStop SQL/MP Programming Manual for COBOL529758-003
5-8
Additional Considerations for SQLCA_DISPLAY2_
The SQLCA can contain a maximum of seven errors and 180 bytes of text of the
actual parameters returned to the program. Information that exceeds these limits is
lost. SQLCA_DISPLAY2_ displays a warning message that indicates when
information is lost.
Example 5-1 on page 5-9 shows a program that performs these functions:
Processes these two transactions in a single server:
TRANS-CODE-1 retrieves a row from a table and displays the row values on a
terminal screen.
TRANS-CODE-2 updates the previously retrieved row with data entered at the
terminal.
Processes these reply codes for the transactions:
REPLY-CODE = 0000 Successful operation occurred.
REPLY-CODE = 9998 Operation failed; record not found.
REPLY-CODE = 9999 Error, operation failed; backout transaction.
Displays an advisory message for each transaction to indicate the result of the
requested operation. The message must be displayed in the advisory line (line 25)
of the terminal screen and be self-explanatory, because the terminal operator has
no knowledge of SQL and no access to an SQL error messages manual.
Processes any error or warning conditions:
Sends SQL warnings only to HOMETERM and not to the terminal. SQL
warnings occur rarely and usually have no meaning for a terminal operator.
Routes SQL errors to HOMETERM for analysis by the database administrator,
suppressing statistics and the internal location of the error message.
HOMETERM is the terminal used by subsystems such as Pathway and TMF to
receive error messages that must be processed by an operator or database
administrator.