博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle 存储过程起步
阅读量:4507 次
发布时间:2019-06-08

本文共 565 字,大约阅读时间需要 1 分钟。

 

 

 

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

select后面要有into

create or replace procedure DelEmp(v_empno in emp.empno%type) ASNo_result EXCEPTION;salary varchar2(40);--nod 18-10-14begindelete 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;

 

 

 

 

转载于:https://www.cnblogs.com/nodchen/p/9788905.html

你可能感兴趣的文章
代码简洁之四 统一抽象层次
查看>>
IOS 缩放图片常用方法
查看>>
软件工程课
查看>>
Pycharm-连接服务器
查看>>
[Leetcode] The Skyline Problem
查看>>
okhttp异步请求流程和源码分析
查看>>
【集合框架】JDK1.8源码分析之Comparable && Comparator(九)
查看>>
Flutter之内置动画(转)
查看>>
uni-app中onLoad不起作用
查看>>
多线程概述
查看>>
Linux_ubuntu命令-用户、权限管理
查看>>
Knowladge_网站学习_RSS 学习
查看>>
TCP/IP,Web世界的基本规则
查看>>
c++ 子类构造函数初始化及父类构造初始化
查看>>
Analysis on Human Various Emotional Expression
查看>>
DataGridView DataGridViewCheckBoxColumn编辑时实时触发事件
查看>>
SignalR---服务端
查看>>
PlayerPrefs存储Vector3等结构数据
查看>>
LightOJ - 1422 Halloween Costumes (区间DP)
查看>>
《面向对象程序设计》——寒假作业3
查看>>