加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Oracle 存储过程起步

发布时间:2020-12-12 13:43:29 所属栏目:百科 来源:网络整理
导读:? ? ? ?存储过程的注释不能写在第一行 select后面要有into create 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 (

?

?

?

?存储过程的注释不能写在第一行

select后面要有into

create 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;

?

?

?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读