G-7450
Error
Never return a NULL value from a BOOLEAN function.
Reason
If a boolean function returns null, the caller has do deal with it. This makes the usage cumbersome and more error-prone.
Example
Non-Compliant Example
create or replace package body my_package is
function my_function return boolean
deterministic
is
begin
return null;
end my_function;
end my_package;
/Issues
| Line | Column | Message |
|---|---|---|
| 6 | 14 |
Compliant Solution - ★★★★★
create or replace package body my_package is
function my_function return boolean
deterministic
is
begin
return true;
end my_function;
end my_package;
/References
- same as Trivadis G-7450