Handling Errors [ ALLBASE/ISQL Reference Manual ] MPE/iX 5.0 Documentation
ALLBASE/ISQL Reference Manual
Handling Errors
Several types of errors can occur while you are using ISQL:
* Command errors.
* DBEnvironment errors.
* Unexpected ISQL or DBEnvironment termination.
Usually, you see an error message when an error occurs. Error messages
are taken from the message catalog. If you are a native language user,
the catalog's name is SQLCTxxx.PUB.SYS, where xxx is the numerical value
for the current language. If this catalog cannot be opened, ALLBASE/SQL
looks for the default NATIVE-3000 message catalog, SQLCT000.PUB.SYS.
Refer to the ALLBASE/SQL Message Manual for information on interpreting
error and warning messages and suggestions on correcting exception
conditions. You can also use the HELP command to obtain information on
command use and structure if a command error occurs.
Command Errors
Commands may contain either syntax or semantic errors. Syntax errors
involve erroneous command structure, as when a required parenthesis or
keyword is omitted. Semantic errors involve erroneous information, as
when the name of a table is misspelled.
When you submit an ISQL or SQL command from the terminal and it contains
errors, you can recall it from the command history buffer, correct it,
then resubmit it. For example:
isql=> UPDATE STATSTICS FOR TABLE PurchDB.Parts;
UPDATE STATSTICS FOR TABLE PurchDB.Parts;
|
Unexpected keyword. (DBERR 1006)
isql=> RECALL HISTORY 1;
UPDATE STATSTICS FOR TABLE PurchDB.Parts;
isql=> CHANGE /STATS/STATIS/;
UPDATE STATISTICS FOR TABLE PurchDB.Parts;
isql=> START;
isql=>
When you are submitting commands from a command file, the CONTINUE option
of the SET command determines what ISQL does when it encounters an
erroneous command. If CONTINUE is ON, ISQL continues processing any
subsequent commands in the command file. If CONTINUE is OFF, ISQL
discontinues processing commands from the file and displays the input
prompt.
When you submit commands from the command buffer, ISQL continues
processing any subsequent commands in the buffer when it encounters an
erroneous command.
[REV BEG]
When the EXIT_ON_DBERR option of the SET command is ON, ISQL will
terminate immediately if an SQL error occurs. The EXIT_ON_DBERR option
has precedence over the CONTINUE option.[REV END]
DBEnvironment Errors
Some errors may be caused by the following conditions in the
DBEnvironment:
* A DBEnvironment is not started yet.
* Resources are insufficient.
* A deadlock has occurred.
Refer to the ALLBASE/SQL Database Administration Guide information on
handling these kinds of errors.
Unexpected ISQL or DBEnvironment Termination
If ISQL stops running or a STOP DBE command is issued while you are
submitting SQL statements, work done by any transactions in progress at
termination is automatically undone when the DBEnvironment is next
started up. Only work up to the last COMMIT WORK executed prior to
termination permanently affects the DBEnvironment.
[REV BEG]
Checking JCWs for Errors
When running ISQL in batch mode, your job can check the following JCWs to
ensure that ISQL completed successfully:
Table 2-3. JCWs Set by ISQL
--------------------------------------------------------------
| | | |
| JCW Name | Contents | Range |
| | | |
--------------------------------------------------------------
| | | |
| ISQLERR | number of SQL errors | 0 - 32767 |
| | encountered | |
| | | |
--------------------------------------------------------------
| | | |
| ISQLWARN | number of SQL warnings | 0 - 32767 |
| | encountered | |
| | | |
--------------------------------------------------------------
| | | |
| JCW1 | FATAL if SQL error encountered | FATAL or 0 |
| | 0 if SQL error not encountered | |
| | | |
--------------------------------------------------------------
1 The system JCW is set only if the EXIT_ON_DBERR option of the SET
command is ON.
[REV END]
MPE/iX 5.0 Documentation