惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - ZH.net

在vb.net中通过ODBC从Oracle 9i向Access倒数据 从SQLSERVER向ORACLE8迁移的技术实现方案 Part V [转] 从SQLSERVER向ORACLE8迁移的技术实现方案 PartIV [转] 从SQLSERVER向ORACLE8迁移的技术实现方案 PartIII [转] 从SQL SERVER向ORACLE的迁移方案[转] PartII Sql Server 转入 Oracle part I (转自网络) 在 .NET 中使用 Oracle 数据库事务 作者:Jason Price 转自oracle.com Oracle的分页以及sequence 一些正则表达式 - ZH.net - 博客园 接昨日,将上传至oracle的excel文件下载下来 将文件(word,excel等)存入oracle的一个字段 .net studio 2005操作dbf文件 Web利用Gloabl.asax实现多线程任务 maintain AD(将一个账号移动到另一个群组) 一個Check AD的类。from MSDN 一些JS ViewState的一些学习笔记 发mail时smtp服务器设置的一个问题 datagrid前加checkbox
Oracle Trigger(转自网络)
ZH.net · 2006-08-02 · via 博客园 - ZH.net

 1. trigger 是自动提交的,不用COMMIT,ROLLBACK

  2. trigger最大为32K,如果有复杂的应用可以通过在TRIGGER里调用PROCEDURE或FUNCTION来实现。

  3. 语法CREATE OR REPLACE TRIGGER <trigger_name>
<BEFORE | AFTER> <ACTION>
ON <table_name>

DECLARE
 <variable definitions>
BEGIN
  <trigger_code>
EXCEPTION
  <exception clauses>
END <trigger_name>;
/

  4. 相关命令
    create trigger
    create any trigger
    administer database trigger
    alter any trigger
    drop any trigger

  5. 对列做触发(of)(行的触发是最常见的,不在这里列出


             1  create or replace trigger tri_wwm
             2  before update of id on wwm2 for each row
             3  declare the_str VARCHAR2(40):='update on wwm2''s id column';
             4  begin
             5      dbms_output.put_line(the_str);
             6* end tri_wwm;
           SQL> /

           Trigger created.

           SQL> update wwm2 set id=3;
           update on wwm2's id column

           1 row updated.

      6. Referencing 别名

          测试数据

           SQL> select * from wwm2;

                   ID NAME
           ---------- ----------
                    1 wwm
                    2 china

          建测试用日志表

             1  create table wwm_log
             2  (o_id number(8),o_name varchar2(10),
             3  n_id number(8),n_name varchar2(10),
             4* op_by varchar2(20),op_date date)
           SQL> /

           Table created.

           建立 触发器

             create or replace trigger tri_refer
            after update of id on wwm2 referencing new as new old as old for each row
            begin
                insert into wwm_log values (:old.id,:old.name,:new.id,:new.name,sysdate,user);
            end;
            /

            更新表以触发事件

           SQL> update wwm2 set id=8 where id=2;
           update on wwm2's id column

           1 row updated.

           SQL> select * from wwm_log;

                 O_ID O_NAME           N_ID N_NAME     OP_DATE   OP_USER
           ---------- ---------- ---------- ---------- --------- -----------------
                    2 china               8 china      09-MAR-06 SYSTEM

                 大家可以用这个方法来对一些操作做日志

      7.Disable/Enable

         ALTER  TRIGGER  tri_refer DISABLE/ENABLE

         ALTER  TABLE wwm2 DISABLE/ENABLE ALL TRIGGERS;

         ALTER TRIGGER tri_refer RENAME TO tri_reference;