We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 865aac4 commit 16d67a4Copy full SHA for 16d67a4
docs/4-language-usage/4-control-structures/2-case-if-decode-nvl-nvl2-coalesce/g-4260.md
@@ -0,0 +1,34 @@
1
+# G-4260: Avoid inverting boolean conditions.
2
+
3
+!!! tip "Minor"
4
+ Maintainability, Testability
5
6
+## Reason
7
8
+It is more readable to use the opposite comparison operator instead of inverting the comparison with `not`.
9
10
+## Example (bad)
11
12
+``` sql
13
+declare
14
+ l_color varchar2(7 char);
15
+begin
16
+ if not l_color != constants_up.co_red then
17
+ my_package.do_red();
18
+ end if;
19
+end;
20
+/
21
+```
22
23
+## Example (good)
24
25
26
27
+ l_color types_up.color_code_type;
28
29
+ if l_color = constants_up.co_red then
30
31
32
33
34
0 commit comments