使用数据库触发.pptVIP

  • 3
  • 0
  • 约6.73千字
  • 约 45页
  • 2017-05-18 发布于贵州
  • 举报
使用数据库触发

建立触发器 关于变异表的问题讨论 create or replace trigger LimitEmployees before insert or update of deptno on emp for each row declare v_Maxemp constant number:=6; v_currentemp number; begin select count(*) into v_currentemp from emp where deptno=:new.deptno; if(v_currentemp+1v_maxemp) then raise_application_error(-20000,员工数量超过名额限制); end if; end; *Oracle 10g数据库管理课程 CISSST 授课教师: 原炜斌 QQ:448920091 使用数据库触发器 目标(Objectives): 触发器种类与定义 只读视图、可更新视图 Instead-Of触发器 新的数据库触发器 使用数据库触发器 数据库触发器是存储在数据库中、根据发生的事件而执行的一种存储子程序。它与存储过程不同的是,存储过程通过其它程序来启动运行或直接启动运行,而触发器是由一个事件来启动运行。即触

文档评论(0)

1亿VIP精品文档

相关文档