SQL> create or replace FUNCTION iifn(boolean_expression in BOOLEAN,
2 true_number IN NUMBER,
3 false_number IN NUMBER)
4 RETURN NUMBER IS
5 BEGIN
6 IF boolean_expression THEN
7 RETURN true_number;
8 ELSIF NOT boolean_expression THEN
9 RETURN false_number;
10 ELSE
11 --nulls propagate, i.e. null input yields null output.
12 RETURN NULL;
13 END IF;
14 END;
15 /
Function created.