You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create or replace package body department_api is
function name_by_id(in_id indepartments.department_id%type)
return departments.department_name%type is
co_id constant departments.department_id%type := in_id;
l_department_name departments.department_name%type;
begin
if true then
select department_name
into l_department_name
from departments
where department_id = co_id;
select department_name
into l_department_name
from departments
where department_id = co_id;
end if;
return l_department_name;
exception
when no_data_found then
return null;
when too_many_rows then
raise;
end name_by_id;
end department_api;
/
It's related to the if statement. Without the if no G-5060 is reported.
We get a violation G-5060 : Avoid unhandled exceptions
with this code (just showing part of the code) :
when we comment the IF statement the violation is no longer there :
The text was updated successfully, but these errors were encountered: