diff --git a/docs/4-language-usage/8-patterns/3-validating-input-parameter-size/g-8310.md b/docs/4-language-usage/8-patterns/3-validating-input-parameter-size/g-8310.md index 4c3e597b..1993ddb7 100644 --- a/docs/4-language-usage/8-patterns/3-validating-input-parameter-size/g-8310.md +++ b/docs/4-language-usage/8-patterns/3-validating-input-parameter-size/g-8310.md @@ -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; / @@ -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; /