Oracle 存储过程起步
时间:2021-07-01 10:21:17
帮助过:4人阅读
or replace procedure DelEmp(v_empno
in emp.empno
%type)
AS
No_result EXCEPTION;
salary varchar2(
40);
--nod 18-10-14
begin
delete from emp
where empno
=v_empno;
select sum(sal)
into salary
from emp
group by ename;
if sql
%NOTFOUND
THEN
RAISE No_result;
end if;
DBMS_OUTPUT.PUT_LINE(‘编码为‘||v_empno
||‘已删除!!!‘);
COMMIT;
exception
when No_result
then
DBMS_OUTPUT.PUT_LINE(‘你要的数据不存在,请确认是否为‘||v_empno);
WHEN others
then
DBMS_OUTPUT.PUT_LINE(‘其他错误,请确认输入‘);
END DelEmp;
Oracle 存储过程起步
标签:技术分享 bubuko 删除 when except image span exce create