|
|
Return Status and Conditions
In Mimer SQL, status information is returned in the
SQLSTATEvariable.This variable must be declared as a 5-character long string (excluding any terminating null byte), and the declaration of
SQLSTATEmust be made betweenBEGIN DECLARE SECTIONandEND DECLARE SECTION. TheSQLSTATEvariable together with theGET DIAGNOSTICSstatement will provide the application with information about the most recently executed SQL statement.For compatibility reasons, error codes can also be returned in
SQLCODE, as in earlier versions of Mimer SQL. However,SQLCODEin Mimer SQL can be either a field in theSQLCA, or a 4-byte integer variable in the application. Mimer SQL will assume the existence of anSQLCODEvariable if noINCLUDE SQLCAstatement is found and neitherSQLSTATEnorSQLCODEis declared betweenBEGIN DECLARE SECTIONandEND DECLARE SECTION.There are three different types of conditions in Mimer SQL:
NOT FOUND,SQLERRORandSQLWARNING(see the WHENEVER).
SQLERRORsare returned using an error code inSQLSTATEor a negative value in theSQLCODEfield. This is referred to as "an error code is returned" in this manual.
SQLWARNINGsare returned by setting either aSuccess with warning-code inSQLSTATE, or by setting theSQLWARNfields in theSQLCAto the characterW. This is referred to as "a warning flag is set" in this manual.The
NOT FOUNDcondition is returned by settingSQLSTATEtoNo data('02000'), or by settingSQLCODEto+100. This is referred to as "a NOT FOUND condition code is returned" in this manual.More detailed information about certain operations can be obtained by the
GET DIAGNOSTICSstatement described in GET DIAGNOSTICS.
|
Mimer Information Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 info@mimer.se |
|
|