Provides conditional execution based on the truth value of a conditional expression.
The IF-statement allows a sequence of procedural-sql-statements to be conditionally executed depending on the truth value a search-condition.
All of the predicates supported by Mimer SQL may be used in the search-condition, see Predicates.
The search-condition is always evaluated directly in the context of the IF-statement, its value cannot be pre-assigned to a data item which is used in its place.
In a basic IF-statement, the sequence of procedural-sql-statements in the THEN clause will be executed if search-condition evaluates to true, otherwise the sequence of procedural-sql-statements in the ELSE clause will be executed.
One or more IF-statements can be nested by using the ELSEIF clause in place of an ELSE clause containing another IF-statement.
search-condition, see Search Conditions.
If the search-condition equals NULL or directly includes the NULL value, it evaluates to unknown and it treated as false. If it is required that the conditional expression test for the NULL value, then the correct behavior is achieved by using the IS NULL predicate, see The NULL Predicate.
SQL/PSM YES Fully compliant.
Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40