This is what I mean:
declare
e_loc exception;
v_name hr.employees.first_name%type;
begin
begin
select first_name
into v_name
from hr.employees
where
employee_id = &v_employee_id ;
dbms_output.put_line('the name is ' || v_name );
exception
when no_data_found then
raise e_loc;
end;
exception
when e_loc then
dbms_output.put_line('nope');
end;
HTH
Cheers,
Norm. [TeamT]
PS. It's Sunday, and the UK is in lockdown. But at least my garage is now very tidy!