Oracle如何判断表存在,若存在则进行删除

declare 
      num   number; 
begin 
      select count(1) into num from all_tables where TABLE_NAME = upper('EMP') and OWNER='SCOTT'; 
      if   num=1   then 
          execute immediate 'drop table EMP'; 
      end   if; 
end; 

posted @ 2018-10-18 21:57  crazyPants  阅读(2825)  评论(0编辑  收藏  举报