Skip to content

Commit c2e946f

Browse files
closes #205 use 3 identical literals in bad example
1 parent 9d5a3bb commit c2e946f

File tree

1 file changed

+7
-31
lines changed

1 file changed

+7
-31
lines changed

docs/4-language-usage/1-general/g-1050.md

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,10 @@ To reduce the number of false positives, the number of occurrences of a literal
1818
## Example (bad)
1919

2020
``` sql
21-
declare
22-
l_job employees.job_id%type;
2321
begin
24-
select e.job_id
25-
into l_job
26-
from employees e
27-
where e.manager_id is null;
28-
29-
if l_job = 'AD_PRES' then
30-
null;
31-
end if;
32-
exception
33-
when no_data_found then
34-
null; -- handle_no_data_found;
35-
when too_many_rows then
36-
null; -- handle_too_many_rows;
22+
some_api.setup(in_department_id => 10);
23+
some_api.process(in_department_id => 10);
24+
some_api.teardown(in_department_id => 10);
3725
end;
3826
/
3927
```
@@ -42,26 +30,14 @@ end;
4230

4331
``` sql
4432
create or replace package constants_up is
45-
co_president constant employees.job_id%type := 'AD_PRES';
33+
co_dept_admin constant departments.department_id%type := 10;
4634
end constants_up;
4735
/
4836

49-
declare
50-
l_job employees.job_id%type;
5137
begin
52-
select e.job_id
53-
into l_job
54-
from employees e
55-
where e.manager_id is null;
56-
57-
if l_job = constants_up.co_president then
58-
null;
59-
end if;
60-
exception
61-
when no_data_found then
62-
null; -- handle_no_data_found;
63-
when too_many_rows then
64-
null; -- handle_too_many_rows;
38+
some_api.setup(in_department_id => constants_up.co_dept_admin);
39+
some_api.process(in_department_id => constants_up.co_dept_admin);
40+
some_api.teardown(in_department_id => constants_up.co_dept_admin);
6541
end;
6642
/
6743
```

0 commit comments

Comments
 (0)