orale 已存在的表和 SEQUENCE 查询和删除

 

orale 已存在的表和 SEQUENCE 查询和删除

 

declare 
      num   number; 
begin 
      select count(1) into num   from all_tables where TABLE_NAME = 'TU_DIS_ES_COMMISSION_HIST' ;
      if   num=1   then 
          execute immediate 'drop table TU_DIS_ES_COMMISSION_HIST'; 
      end   if; 
      
      
			select  count(1) into num  from  user_sequences  where  sequence_name= UPPER('seq_dis_es_commission_hist');
      
       if   num=1   then 
          execute immediate 'drop SEQUENCE seq_dis_es_commission_hist'; 
      end   if; 
      
end; 
/ 

  

posted @ 2013-12-12 15:36  唐增辉  阅读(156)  评论(0)    收藏  举报
****************************************** 页脚Html代码 ******************************************