我在PL-SQL中触发一个触发器,用于限制我的员工输入表上的部门/部门 中的员工我收到ORA-01403:找不到数据。 请人帮我PLSQL触发器ORA 01403找不到数据
create or replace trigger DEPT_STRENTH
after insert on empmasterinfo
for each row
DECLARE
-- local variables here
EMP_Count NUMBER;
MAX_Strength NUMBER;
V_Mainid VARCHAR2(100);
V_orgelementname VARCHAR2(100);
BEGIN
--taking value from form
V_Mainid := :new.mainid;
V_orgelementname := :new.orgelementname;
--Comparing values with existing
select d.strength
into MAX_Strength
from dept_strength d
-- Master table
where d.Mainid = V_Mainid
and d.orgelementname = V_orgelementname;
select count(e.employeeid)
into EMP_Count
-- Master table
from empmasterinfo e
where e.emp_status = 0
and e.Mainid = V_Mainid
and e.orgelementname = V_orgelementname;
if EMP_Count >= MAX_Strength then
RAISE_APPLICATION_ERROR(-20101,
'Maximum Number of Employees in Department Reached');
end if;
end DEPT_STRENTH;
您什么时候收到此消息?当触发器触发?更重要的是,你是否在网上做过任何研究?只是搜索'ORA-01403'返回很多有用的命中。 –
是的,我做爱,但仍然没有得到欲望的结果。在插入表格之前引发火灾。当有人在表 – user3024346