ORACLE 判断触发器是否存在,如果存在就删除
2012-06-06 12:35
337 查看
declare
V_NUM number;
BEGIN
----多次删除时,每次都将v_num设置成为0
V_NUM := 0;
----判断触发器 TABLE_NAME 是否存在(区分大小写)
select count(0) into V_NUM from user_triggers where trigger_name = 'tib_bpd_business_process_link';
----如果存在立即删除
if V_NUM > 0 then
execute immediate 'DROP TRIGGER tib_bpd_business_process_link';
end if;
----多次删除时,每次都将v_num设置成为0
V_NUM := 0;
----判断触发器 TABLE_NAME 是否存在(区分大小写)
select count(0) into V_NUM from user_triggers where trigger_name = 'tib_bpd_interface_service';
----如果存在立即删除
if V_NUM > 0 then
execute immediate 'DROP TRIGGER tib_bpd_interface_service';
end if;
END;
V_NUM number;
BEGIN
----多次删除时,每次都将v_num设置成为0
V_NUM := 0;
----判断触发器 TABLE_NAME 是否存在(区分大小写)
select count(0) into V_NUM from user_triggers where trigger_name = 'tib_bpd_business_process_link';
----如果存在立即删除
if V_NUM > 0 then
execute immediate 'DROP TRIGGER tib_bpd_business_process_link';
end if;
----多次删除时,每次都将v_num设置成为0
V_NUM := 0;
----判断触发器 TABLE_NAME 是否存在(区分大小写)
select count(0) into V_NUM from user_triggers where trigger_name = 'tib_bpd_interface_service';
----如果存在立即删除
if V_NUM > 0 then
execute immediate 'DROP TRIGGER tib_bpd_interface_service';
end if;
END;
相关文章推荐
- ORACLE 判断表是否存在,如果存在就删除
- oracle创建表之前判断表是否存在,如果存在则删除已有表
- ORACLE 判断序列是否存在,如果存在就删除
- oracle创建表之前判断表是否存在,如果存在则删除已有表
- oracle创建表之前判断表是否存在,如果存在则删除已有表
- oracle创建表之前判断表是否存在,如果存在则删除已有表
- oracle创建表之前判断表是否存在,如果存在则删除已有表
- oracle创建表之前判断表是否存在,如果存在则删除已有表
- oracle和mysql数据库创建表之前判断表是否存在,如果存在则删除已有表,以及在这两个库中创建表
- oracle创建表之前判断表是否存在,如果存在则删除已有表
- oracle创建表之前判断表是否存在,如果存在则删除已有表
- oracle创建表之前判断表是否存在,如果存在则删除已有表
- Oracle删除表、字段之前判断表、字段是否存在
- Oracle之 在创建Table之前先判断是否存在,存在就删除
- Oracle删除字段之前判断字段是否存在
- 判断目录是否存在, 如果存在, 则可以删除.
- Oracle删除字段之前判断字段是否存在
- [转]sql server 2000/2005 判断存储过程、触发器、视图是否存在并删除
- Oracle删除表之前判断表是否存在
- sql server 2000/2005 判断存储过程、触发器、视图是否存在并删除