oracle判断表是否存在,如果存在就删除

-- 判断是否存在declare num number; begin select count(*) into num from user_tables
-- 判断是否存在
declare num   number; 
begin select count(*) into num from user_tables where table_name =upper('mid_bd_corp'); if   num = 1   then execute immediate 'drop table mid_bd_corp'; end if; 
end; 
/
--创建表
create table mid_bd_corp
(BAG_ID               VARCHAR2(36 BYTE)    not null,USER_ID              VARCHAR2(36 BYTE)    not null,TYPE                 VARCHAR2(36 BYTE),ASSOCIATED_FIELD     VARCHAR2(36 BYTE),constraint PK_DPMS_BAG_FILE primary key (BAG_ID, USER_ID)
);