


A Boolean expression describes a condition which either is true or is not true at the time of evaluation. The flow of a routine can be dynamically controlled by means of Boolean expressions in IF, REPEAT, and WHILE statements.
A frequent use is the comparison between two arithmetic expressions. If both expressions result in the NULL value, they are regarded as unequal. With the predicate IS NULL it can be checked whether a variable has been set to NULL.

In logical expressions, the NULL value is always interpreted as 'false' and every other value as 'true'.
The following examples show how simple conditions can be formulated in an SQL-PL routine.

These simple conditions can be combined with the operators AND, OR, and NOT to form more complex Boolean expressions. Explicit parentheses enforce the desired sequence of evaluation even in this case.
For LIKE, all facilities are available that are also known to ADABAS in the LIKE predicate (see ADABAS Reference Manual).
IS ALPHA checks whether the expression only consists of letters and blanks.
The predicate IS DATE (IS TIME) checks whether the variable content is a date or a time in the specified format. If no format has been specified, a check is made for agreement with the format set in the SET parameters.
The predicate IS MODIFIED allows a request to be made whether a form input field has been changed by the user the last time the form was called. It can be specified that, for example, database insertions are only to be made when this request produces a particular result. Outside of a form, the predicate IS MODIFIED can only be applied to global variables of the form.
In addition, the predicate FORM IS MODIFIED can be used to find out in an easy way whether an input field of the form has been changed by the final user.
Predicates ALL, ANY, ONE
The predicates ALL, ANY, and ONE facilitate the Boolean expressions with regard to vector slices. The predicates EACH and SOME are synonyms for ALL and ANY resp.
Examples:

Syntax:




