(Contents)(Previous)(Next)

SQL Error Handling

The execution of an SQL statement always returns a numeric code that can be retrieved by the routine via the variable $RC (synonym: $SQLCODE). The variable $RT (synonym: $SQLERRMC) returns an explanation of the error of up to 80 characters in length.

These SQL return codes should be handled in the routine immediately after the SQL statement.

Example:

As a rule, negative SQL return codes refer to error situations that have nothing to do with the application itself (syntax errors, operating state of the database, missing catalog definitions).


(Contents)(Previous)(Next)