Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


Return Status and Conditions


In Mimer SQL, status information is returned in the SQLCODE and SQLSTATE variables.

The SQLSTATE variable must be declared as a 5-character long string (excluding any terminating null byte), and the declaration of SQLSTATE must be made between BEGIN DECLARE SECTION and END DECLARE SECTION. The SQLSTATE variable together with the GET DIAGNOSTICS statement will provide the application with information about the most recently executed SQL statement.

The SQLCODE variable must be declared as integer. If neither an SQLSTATE nor an SQLCODE variable is declared between BEGIN DECLARE SECTION and END DECLARE SECTION, Mimer SQL will assume the existence of an SQLCODE variable. (I.e. declared somewhere outside the declare section, but still within scope.)

There are three different types of conditions in Mimer SQL; NOT FOUND, SQLERROR and SQLWARNING (see the WHENEVER).

The NOT FOUND condition is returned by setting SQLSTATE to No data ('02000'), or by setting SQLCODE to +100. This is referred to as "a NOT FOUND condition code is returned" in this manual.

SQLERROR's are returned using an error code in SQLSTATE, or a negative value in SQLCODE. This is referred to as "an error code is returned" in this manual.

SQLWARNING's are returned by setting either a Success with warning -code in SQLSTATE, or a value > 0 in SQLCODE. This is referred to as "a warning flag is set" in this manual.

More detailed information about certain operations can be obtained by the GET DIAGNOSTICS statement described in GET DIAGNOSTICS.


Mimer
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
info@mimer.se
Mimer SQL Documentation TOC PREV NEXT INDEX