摘要: 1 一.触发器 2 分类: 3 (1)行级触发器:DML,如果操作批量数据,会出现多个影响语句 4 (2)语句级触发器:DML ,如果操作批量数据,会出现一个影响语句 5 (3)instead of 触发器 6 (4)模式触发器:DDL 7 (5)数据库级触发器 :数据库登陆、注销等操作 8 9 --行级触发器语法 10 create or replac... 阅读全文
posted @ 2016-07-24 22:40 红酒人生 阅读(596) 评论(0) 推荐(1) 编辑
摘要: 一.示例1 1 --存储过程 2 create or replace procedure addemp( var_sal in out number ) 3 is|as 4 5 begin 6 7 end; 8 9 --函数 10 create or replace function addemp( 阅读全文
posted @ 2016-07-24 22:39 红酒人生 阅读(492) 评论(1) 推荐(1) 编辑
摘要: 1 --注意:函数必须有返回值 2 --创建函数 3 create or replace function f_emp(p_empno number) 4 return number 5 is 6 --定义存储返回值的变量 7 v_sal emp.sal%type; 8 begin 9 --查询操作 10 select sal into v_sal from ... 阅读全文
posted @ 2016-07-24 22:36 红酒人生 阅读(318) 评论(0) 推荐(1) 编辑