oracle 笔记 V 之触发器 (TRIGGER)
触发器 trigger
分类:前触发,后触发
行触发器,语句触发器
行触发器与语句触发器的区别:
行触发器要求当一个 DML 语句操作影响数据库中的多行数据时,对于其中的每个数据行,只要它们符合触发约束条件,均激活一次触发器,FOR EACH ROW 选项说明触发器为行触发器;
语句触发器将整个语句操作 作为触发事件,当它们符合约束条件时,激活一次触发器
创建语法:
create or replace trigger trigger_name
before |after
insert |delete | update |{[of column[,column ...]]
on [schema.]table_name
for each row
[when condition]
trigger_body;
eg(仔细体会):
create or replace trigger hello_tri
before insert or delete or update on emp
for each row
begin
dbms_output.put_line('我是触发器!');
end;
相关文档:
DML(Manipulation):数据操作语言
CRUD
DDL(Definition): 数据定义语言,与表,索引,同义词有关
create,alter,drop,rename,truncate(清空)
DCL(Control): 数据控制语言,与权限有关
grant,revoke
TCL(Transaction Control): 事务控制语言,与事务有关
commit,rollback,savepoint
==========================
存储 ......
This course is aim to train the great DBA with good English speaking.
In recent years, more demands of Oracle DBA, but most of Senior DBAs are required to speak good English.
English has become the great barrier for more peoples in their career development, you must have the deep feeling about it ......
SQL SERVER临时表
也可以创建临时表。临时表与永久表相似,但临时表存储在 tempdb 中,当不再使用时会自动删除。
有本地和全局两种类型的临时表,二者在名称、可见性和可用性上均不相同。本地临时表的名称以单个数字符号 (#) 打头;
它们仅对当前的用户连接是可见的;当用户从 Microsoft? SQL Server? 2000 实例断 ......