--判断表是否存在,存在就删除
declare
v_exists number;
begin
select count(*) into v_exists from user_tables where table_name = 'LLT_CONSUMERPVSHIELDRECORD';
if v_exists > 0 then
execute immediate 'drop table LLT_CONSUMERPVSHIELDRECORD';
end if;
end;
/
--判断视图是否存在,存在就删除
declare
v_exists number;
begin
select count(*) into v_exists from user_views where view_name = 'V_LLT_CONSUMERPVSHIELDRECORD';
if v_exists > 0 then
execute immediate 'drop view V_LLT_CONSUMERPVSHIELDRECORD';
end if;
end;
/
转载于:https://my.oschina.net/kkrgwbj/blog/322787