SQL Server中
if exists (select 1 from sysobjects where id = object_id('userno.aa')
and type = 'U') drop table userno.aa
如何替换成oracle
if exists (select 1 from sysobjects where id = object_id('userno.aa')
and type = 'U') drop table userno.aa
如何替换成oracle
n number;
t_name varchar2(100);
begin
t_name:='userno.aa';
select count(*) into n from user_tables where table_name=upper(t_name);
if n>0 then
execute immediate 'drop table '||t_name;
end if;
end;这里只是指当前用户下的表