HPlogo ISQL Reference Manual for ALLBASE/SQL and IMAGE/SQL: HP 3000 MPE/iX Computer Systems > Chapter 2 Getting Started with ISQL

Handling Errors

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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.

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.

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.

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 NameContentsRange
ISQLERRnumber of SQL errors encountered0 - 32767
ISQLWARNnumber of SQL warnings encountered0 - 32767
ISQLLASTERRlast DBERR number encountered0 - 32767
ISQLLASTWARNlast DBWARN number encountered0 - 32767
JCW[1]FATAL if SQL error encountered 0 if SQL error not encounteredFATAL or 0

[1] The system JCW is set only if the EXIT_ON_DBERR option of the SET command is ON.

 

Feedback to webmaster