--错误处理
declare
v_count number(4);
begin
select empno into v_count from emp where deptno=10;
exception
when too_many_rows then
dbms_output.put_line('太多记录了');
when no_data_found then--数据没有找到异常
dbms_output.put_line('没有数据');
when others then
dbms_output.put_line('error');
end;
/
set serveroutput on;
//Oracle 中PL 语句写的多了移植到其他的数据库如db2,sqlserver,mysql中的可能性就会降低