EVEN scalar function
The EVEN scalar function returns a Boolean value that indicates whether the argument is divisible by two.
Authorization: None required.
The schema is SYSTOOLS.
- expression
- An expression that returns a value of any built-in numeric, character-string, or graphic-string data type. The argument is cast to big integer before evaluating the function. Any fractional digits are truncated.
If the argument can be null, the result can be null; if the argument is null, the result is the null value.
The result of the function is Boolean. If the number is evenly divisible by 2, it returns a value of true. Otherwise, it returns a value of false.
Note
This function is provided in the SYSTOOLS schema as an example of extending an SQL built-in function. Similar to other Db2® for i provided tools within SYSTOOLS, the SQL source can be extracted and used as a model for building similar helper functions, or to create a customized version within a user-specified schema.
Example
- Determine whether the input argument is an even
number.
Returns FALSE.VALUES SYSTOOLS.EVEN(17);

