6. Working with Transactions and Handling Errors : Error Handling : Error Handling in Embedded Applications : Error Checking Using Inquire Statements
 
Share this page                  
Error Checking Using Inquire Statements
The inquire statements that can be used to perform error checking are:
INQUIRE_SQL and INQUIRE_FRS
Both statements return error numbers and messages using the constants errorno and errortext. INQUIRE_SQL returns the error number and text for the last executed SQL database statement. INQUIRE_FRS returns the same information about the last executed forms statement. Unlike the WHENEVER statement, an inquire statement must be executed immediately after the database or forms statement in question. By default, INQUIRE_SQL(ERRORNO) returns a generic error number, but the SET_SQL statement can be used to specify that local errors are returned. For a discussion of local and generic errors, see Types of Errors (see page Types of Error Codes).
Neither of the inquire statements suppress the display of error messages. Both of the inquire statements return a wide variety of information in addition to error numbers and text.