SQL/MX 2.x Database and Application Migration Guide (G06.23+, H06.04+, J06.03+)

Converting SQL/MP Applications to SQL/MX
Applications
HP NonStop SQL/MX Database and Application Migration Guide540435-005
10-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 should execute an error-handling procedure and pass
control back to the main program.
All the character data could not fit in the
target buffer, so the truncated result was
put in the buffer.
-8403 -8402 22001
The denominator value for division was
zero, so the statement failed.
-8408 -8419 22012
No indicator variable was specified for a
null value and the output value is null, so
the statement failed.
-8423 -8420 22002
An attempt was made to move a null
value into a field that requires not null
values, so the statement failed.
-8424 -8421,
-8425
23000,
X08BT
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 10-13. Mapping SQL/MP SQLCODE to SQL/MX SQLCODE
Values (page4of4)
SQL/MP Error Description
SQL/MP
SQLCODE
SQL/MX
SQLCODE
SQL/MX
SQLSTATE