G-2410: Try to use boolean data type for values with dual meaning.
Minor
Maintainability
Reason
The use of TRUE and FALSE clarifies that this is a boolean value and makes the code easier to read.
Example (bad)
1 2 3 4 5 6 7 8 9 10 11 12 | declare k_newfile constant pls_integer := 1000; k_oldfile constant pls_integer := 500; l_bigger pls_integer; begin if k_newfile < k_oldfile then l_bigger := constants.k_numeric_true; else l_bigger := constants.k_numeric_false; end if; end; / |
Example (better)
1 2 3 4 5 6 7 8 9 10 11 12 | declare k_newfile constant pls_integer := 1000; k_oldfile constant pls_integer := 500; l_bigger boolean; begin if k_newfile < k_oldfile then l_bigger := true; else l_bigger := false; end if; end; / |
Example (good)
1 2 3 4 5 6 7 8 | declare k_newfile constant pls_integer := 1000; k_oldfile constant pls_integer := 500; l_bigger boolean; begin l_bigger := nvl(k_newfile < k_oldfile,false); end; / |