标签:
/* 创建一个触发器禁止新建对象*/
SQL> CREATE TRIGGER no_create 2 AFTER CREATE ON SCHEMA 3 BEGIN 4 RAISE_APPLICATION_ERROR( 5 -2000, 6 ‘ERROR:Objects cannot be created in the production database.‘ 7 ); 8 END; 9 /
Trigger created
SQL> CREATE TABLE demo(col1 NUMBER); CREATE TABLE demo(col1 NUMBER) ORA-00604: 递归 SQL 级别 1 出现错误 ORA-21000: -2000 的 raise_application_error 错误号参数超出范围 ORA-06512: 在 line 2
/*创建一个禁止删除对象的触发器*/
CREATE OR REPLACE TRIGGER undroppable BEFORE DROP ON SCHEMA BEGIN RAISE_APPLICATION_ERROR(-20000,‘You cannot drop me!I am invincible!‘); END;
标签:
原文地址:http://my.oschina.net/u/1866459/blog/499308