SQL/MX Comparison Guide for SQL/MP Users
Embedded SQL
HP NonStop SQL/MX Comparison Guide for SQL/MP Users—523735-003
4-9
WHENEVER Declarative
* Not available. The current release of NonStop SQL/MX does not support the SQL/MP
CONTROL TABLE SKIP UNAVAILABLE PARTITION option.
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.
For information about handling errors, see Diagnostics Area, next.
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 declare
the communication area by using the INCLUDE SQLCA directive.
NonStop SQL/MX does not provide the SQL communication area or use the INCLUDE
SQLCA directive. Instead, NonStop SQL/MX follows the ANSI SQL:1999 standard by
automatically providing a diagnostics area that stores completion and exception
information.
At the beginning of the execution of an SQL statement, the diagnostics area is emptied
by the preprocessor. When the statement executes, NonStop SQL/MX places
completion and exception information in this area. You can access the information in
the diagnostics area by using the GET DIAGNOSTICS statement.
SQL_PARTITION_NOT_AVAIL -8239 * *
SQL_FILE_SYSTEM_ERROR -8300 -8551 -
SQL_NO_INDICATOR_VAR -8423 -8420 22002
SQL_LOST_OPEN_WARN 8204 8574 -
SQL_LOST_OPEN_ERROR -8204 -8574 -