17,086
社区成员
发帖
与我相关
我的任务
分享
begin
if exists(select * from user_tables where table_name = 'TMP_ST') then
execute immediate 'drop table TMP_ST';
end if;
end;
--oracle不是这样的语法
declare
cnt number;
begin
select count(*) into cnt from user_tables where table_name = 'TMP_ST';
if cnt>0 then
execute immediate 'drop table TMP_ST';
end if;
end;
--你的写法是MSSQL的语法,Oracle不支持
declare
cnt number;
begin
select Count(*) into cnt from user_tables where table_name = 'TMP_ST' ;
if cnt>0 then
execute immediate 'drop table TMP_ST';
end if;
end;