判断表是否存在 存储

create or replace procedure pro_tableesists (v_table in varchar2) is
v_num number;
begin
  select count(*) into v_num from user_objects where object_name=upper(v_table);
  if  v_num>0 then 
    execute immediate  'drop table '||v_table;
    end if;
  
end pro_tableesists ;

也可以 'drop table '||v_table||'purge;'

原文地址:https://www.cnblogs.com/tianmingt/p/4177467.html