create or replace procedure SAL as
SALERR exception;
TEMSAL EMP.SAL%type;
begin
select SAL into TEMSAL from EMP where EMPNO = 8900; if TEMSAL < 1000 or TEMSAL > 3000 then
raise SALERR;
end if;exception
when NO_DATA_FOUND then
DBMS_OUTPUT.PUT_LINE('超出员工范围');
when SALERR then
DBMS_OUTPUT.PUT_LINE('超出薪水范围');
end SAL;
/
SALERR exception;
TEMSAL EMP.SAL%type;
begin
select SAL into TEMSAL from EMP where EMPNO = 8900; if TEMSAL < 1000 or TEMSAL > 3000 then
raise SALERR;
end if;exception
when NO_DATA_FOUND then
DBMS_OUTPUT.PUT_LINE('超出员工范围');
when SALERR then
DBMS_OUTPUT.PUT_LINE('超出薪水范围');
end SAL;
/
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货