Mimer SQL Programmer's Manual TOC PREV NEXT INDEX

Mimer Developer Site


The SQLSTATE Variable

The SQLSTATE variable provides the application, in a standardized way, with return code information about the most recently executed SQL statement.

SQLSTATE must be declared between the BEGIN DECLARE SECTION and the END DECLARE SECTION (i.e. in the SQL declare section), as a 5 character long string (excluding any terminating null byte).

The return codes provided by SQLSTATE can contain digits and capital letters.

SQLSTATE consists of two fields. The first two characters of SQLSTATE indicates a class, and the following three characters indicates a subclass. Class codes are unique, but subclass codes are not. The meaning of a subclass code depends on the associated class code.

To determine the category of the result of an SQL statement, the application can test the class of SQLSTATE according to the following:

Result category
Success with warning
No data

For a list of SQLSTATE values, see Return Codes.

Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
Mimer SQL Programmer's Manual TOC PREV NEXT INDEX