Declares a condition name for an exception condition value.
An exception condition may be specified by using an SQLSTATE value. It is also possible, within a compound SQL statement, to declare a condition name to represent an exception condition.
The condition name may be declared to represent an SQLSTATE value or it may exist on its own.
If an exception is raised (by executing SIGNAL or RESIGNAL) using a condition name that is not associated with an SQLSTATE value, the SQLSTATE value 45000 (RETURNED SQLSTATE) will be retrieved from the diagnostics area by the GET DIAGNOSTICS statement when the RETURNED_SQLSTATE option is used.
Condition names allow representations of exception conditions to be declared that are more meaningful and readable than an SQLSTATE value.
A condition name which represents an SQLSTATE value may only be declared to represent a specific SQLSTATE value, i.e. it is not possible to declare a condition name to represent an exception class group. For a description of exception class groups, see DECLARE HANDLER.
The scope of a condition name covers all the procedural SQL statements in the compound statement declaring it, including any other compound statements nested within it.
The general naming rules for a condition name are the same as those for other database objects.
If a condition name is declared to represent a particular SQLSTATE value, another condition name cannot exist for that same SQLSTATE value which has exactly the same scope.
A condition name cannot be declared for an SQLSTATE value with class 'successful completion', this covers all SQLSTATE values starting with 00.
The SQLSTATE value string is five characters long and contains only alphanumeric characters.
In Mimer SQL any SQLSTATE value that falls outside the range of standard SQLSTATE values is treated as an implementation-defined value.
Standard SQLSTATE values begin with the characters A-I, S, 0-4 and 7, while implementation-defined SQLSTATE values begin with the characters J-R, T-Z, 5-6 and 8-9.
ExampleDECLARE invalid_parameter CONDITION FOR SQLSTATE 'UE456';
For more information, see Mimer SQL Programmer's Manual, chapter 12, Declaring Condition Names.
SQL/PSM YES Fully compliant.
Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40