20110418_批处理sql 语句的写法_oracle !!的使用

来源:互联网 发布:mac怎么显示图片尺寸 编辑:程序博客网 时间:2024/06/05 14:14

--查询
select 'drop view ' || object_name || ';'
from user_objects
where object_type='VIEW'
and status='INVALID';
--执行


2.  删除所有客户化触发器,即所有非“_T”结束的触发器;
备份触发器trigger_backup.sql

--查询
select 'DROP trigger ' || trigger_name || ';'
from user_triggers where
(trigger_name not like '%\_T' escape '\')
and (upper(trigger_name) not in (select upper(triggername) from maxtriggers)) ;
--执行

 

3、

原因:父设备存在的设备编码,在系统中不存在。
解决:删除此种数据

select 'update equipment e set e.parent=null where e.eqnum='||a.eqnum|| ';'
from equipment a
    where not exists (select 1 from equipment b where a.parent = b.eqnum)
      and a.parent is not null

原创粉丝点击