File tree Expand file tree Collapse file tree 1 file changed +7
-31
lines changed
docs/4-language-usage/1-general Expand file tree Collapse file tree 1 file changed +7
-31
lines changed Original file line number Diff line number Diff 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;
2321begin
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 );
3725end;
3826/
3927```
4230
4331``` sql
4432create 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 ;
4634end constants_up;
4735/
4836
49- declare
50- l_job employees .job_id %type;
5137begin
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 );
6541end;
6642/
6743```
You can’t perform that action at this time.
0 commit comments