SQL/MP to SQL/MX Database and Application Migration Guide
Converting SQL/MP Applications to SQL/MX
Applications
HP NonStop SQL/MP to NonStop SQL/MX Database and Application Migration Guide—666211-001
4-52
Error Handling
WHENEVER Declarative
In NonStop SQL/MP, the WHENEVER declarative specifies an action to take when an
error, warning, or no-rows-found condition occurs. Further, NonStop SQL/MP supports
all three actions: CONTINUE, GO TO (or GOTO), and PERFORM (in COBOL) or
CALL (in C).
NonStop SQL/MX continues to support all three conditions, although SQL:1999
supports only SQLERROR and NOT FOUND.
In addition, NonStop SQL/MX continues to support all three actions, although
SQL:1999 supports only CONTINUE and GO TO. Without PERFORM and CALL, the
WHENEVER declarative is inadequate; the problem with supporting only CONTINUE
and GO TO is that a program must pass control to a named procedure. The
assumption is that an error is reported by the procedure, and the application halts
execution. However, in many situations, an application can recover from errors.
Therefore, your application must execute an error-handling procedure and pass control
back to the main program.
For information about handling errors, see Diagnostics Area
.
In NonStop SQL/MP, the WHENEVER declarative requires a colon (:) before the target
location for the GO TO, PERFORM (in COBOL), or CALL (in C) actions. This
restriction is removed in NonStop SQL/MX.
Diagnostics Area
NonStop SQL/MP provides a communication area (SQLCA) that enables an
application program to check the status of SQL statement execution. You can use the
INCLUDE SQLCA directive to declare the communication area.
Either an invalid date-time value was
entered or the result of a date-time
expression produced an invalid date-time
value, so the statement failed.
-8425 -8416 22008
The date-time or interval value contained
in the input parameter or host variable
had an incorrect format, so the input
value was rejected and the statement
failed.
-8426 -8422 22007
The length of the trim character operand
was not 1 and the TRIM function requires
it, so the operation failed.
-8431 -8404 22027
Table 4-13. Mapping SQL/MP SQLCODE to SQL/MX SQLCODE
Values (page4of4)
SQL/MP Error Description
SQL/MP
SQLCODE
SQL/MX
SQLCODE
SQL/MX
SQLSTATE










