select count(*) from user_tables where table_name='tb1Buy';
if count(*)值>0 then
   drop from tb1Buy;
end if;至于Type='U'不懂

解决方案 »

  1.   

    是drop table tb1Buy,不好意思,写错了
      

  2.   

    declare 
        iCount number;
    begin
        select count(*) into iCount from dbo.sysobjects  a where a.name='tblBuy' and a.Type='U';
        if iCount>0 then 
            drop table tblBuy;
            commit;
         else
            null;
         end if;
    end;
      

  3.   

    declare 
        iCount number;
    begin
        select count(*) into iCount from dbo.sysobjects a where a.name='TBLBUY';
        if iCount>0 then 
            execute immediate 'drop table tblBuy';
         end if;
    end;
    /您需要有drop any table的权限。
    注意,数据字典中都是大写的。
      

  4.   

    declare
    num number;
    begin
    select nvl(max(1),0) into num from user_tables where table_name='TBLBUY';
    if num>0 then
    ...
    else
    ...
    end if;
    end;
    /
      

  5.   


    select COUNT(*) FROM TAB WHERE TNAME ='TBLBUY'