File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
docs/4-language-usage/8-patterns/3-validating-input-parameter-size Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -13,17 +13,18 @@ This technique raises an error (`value_error`) which may not be handled in the c
13
13
create or replace package body department_api is
14
14
function dept_by_name(in_dept_name in departments .department_name %type)
15
15
return departments%rowtype is
16
- l_return departments%rowtype;
16
+ r_return departments%rowtype;
17
17
begin
18
18
if in_dept_name is null or length(in_dept_name) > 20 then
19
19
raise err .e_param_to_large ;
20
20
end if;
21
21
-- get the department by name
22
22
select *
23
+ into r_return
23
24
from departments
24
25
where department_name = in_dept_name;
25
26
26
- return l_return ;
27
+ return r_return ;
27
28
end dept_by_name;
28
29
end department_api;
29
30
/
@@ -36,14 +37,15 @@ create or replace package body department_api is
36
37
function dept_by_name(in_dept_name in departments .department_name %type)
37
38
return departments%rowtype is
38
39
l_dept_name departments .department_name %type not null := in_dept_name;
39
- l_return departments%rowtype;
40
+ r_return departments%rowtype;
40
41
begin
41
42
-- get the department by name
42
43
select *
44
+ into r_return
43
45
from departments
44
46
where department_name = l_dept_name;
45
47
46
- return l_return ;
48
+ return r_return ;
47
49
end dept_by_name;
48
50
end department_api;
49
51
/
You can’t perform that action at this time.
0 commit comments