存储过程中的错误

j284197330 j284197330 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
set serveroutput on size 10000;
create or replace procedure set_sal(p_empno emp.empno%type)
as
p_sal emp.sal%type;
p_deptno emp.deptno%type;
begin
select sal , deptno into p_sal,p_deptno from emp where empno=p_empno;
case p_deptno
when 10 then update emp set p_sal=p_sal+150;
when 20 then update emp set p_sal=p_sal+200;
when 30 then update emp set p_sal=p_sal+250;
else set p_sal=p_sal+300;
end case;
commit;
exception
when no_data_found then
dbms_output.put_line('the department doesn''t exists!');
end set_sal;


警告:Warning: compiled but with compilation errors
...全文

相关推荐

oracle存储过程编译错误问题

NULL 博文链接:https://forlab.iteye.com/blog/1821751

weixin_38669628

mysql存储过程之错误处理实例详解

主要介绍了mysql存储过程之错误处理,结合实例形式详细分析了mysql存储过程错误处理相关原理、操作技巧与注意事项,需要的朋友可以参考下

weixin_38699302

MySQL存储过程相互调用并获得错误码示例

代码如下: mysql> mysql> delimiter $$ mysql> mysql> CREATE PROCEDURE myProc() -> MODIFIES SQL DATA -> BEGIN -> DECLARE l_status VARCHAR(20); -> -> CALL myProc1(l_status); -> IF l_status=’Duplicate Entry’ THEN -> SELECT CONCAT(‘Warning: using existing definition for location ‘) AS warning; -> END IF; -> E

weixin_38558870

mysql存储过程之引发存储过程中的错误条件(SIGNAL和RESIGNAL语句)实例分析

本文实例讲述了mysql引发存储过程中的错误条件(SIGNAL和RESIGNAL语句)。分享给大家供大家参考,具体如下: 在mysql中,我们可以使用SIGNAL和RESIGNAL语句来引发存储过程中的错误条件。 先来看,SIGNAL语句。我们通常使用SIGNAL语句在存储的程序(例如存储过程,存储函数,触发器或事件)中向调用者返回错误或警告条件。 SIGNAL语句提供了对返回值(如值和消息SQLSTATE)的信息的控制。来看下它的语法结构: SIGNAL SQLSTATE | condition_name; SET condition_information_item_name_1 = v

PLAN 向前进,决战大洋!

DB2数据库创建存储过程时遇到的错误

本文将为大家介绍了DB2数据库创建存储过程时遇到的错误。

weixin_38731239
评论 11
收藏 已收藏
分享
返回顶部
j284197330
Oracle 17,133 成员 55,258 内容