a definition
The No_data_found exception is raised when the query data is not found.
Two examples
--系统例外:no_data_found
set serveroutput on
declare
pename emp.ename%type;
begin
--查询员工号时1234的员工的姓名
select ename into pename from emp where empno =1234;
exception
when no_data_found then dbms_output.put_line('没有找到该员工');
when others then dbms_output.put_line('其他例外');
end;
/
Three running results
The employee was not found