Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ This technique raises an error (`value_error`) which may not be handled in the c
create or replace package body department_api is
function dept_by_name(in_dept_name in departments.department_name%type)
return departments%rowtype is
l_return departments%rowtype;
r_return departments%rowtype;
begin
if in_dept_name is null or length(in_dept_name) > 20 then
raise err.e_param_to_large;
end if;
-- get the department by name
select *
into r_return
from departments
where department_name = in_dept_name;

return l_return;
return r_return;
end dept_by_name;
end department_api;
/
Expand All @@ -36,14 +37,15 @@ create or replace package body department_api is
function dept_by_name(in_dept_name in departments.department_name%type)
return departments%rowtype is
l_dept_name departments.department_name%type not null := in_dept_name;
l_return departments%rowtype;
r_return departments%rowtype;
begin
-- get the department by name
select *
into r_return
from departments
where department_name = l_dept_name;

return l_return;
return r_return;
end dept_by_name;
end department_api;
/
Expand Down