if exists (select 1 from all_tables where table_name='TMP_SQLLDR_TABLE')
   drop table tmp_sqlldr_Table这么写行吗?

解决方案 »

  1.   

    那样也可以,也可以这样;
    if exists(select 1 from user_tables  where upper(table_name)='TMP_SQLLDR_TABLE')
    drop table TMP_SQLLDR_TABLE ;
    end if ;
      

  2.   

    还有一种方法是直接drop table,然后看出错代码,如果是ora-942,表示表不存在,当正常处理,其他错误则当异常处理。
      

  3.   

    你这样写:
    if exists(select 1 from user_tables  where upper(table_name)='TMP_SQLLDR_TABLE') 
      execute immediate drop table TMP_SQLLDR_TABLE ; 
    end if ; 
      

  4.   

    你这样写: 
    if exists(select 1 from user_tables  where upper(table_name)='TMP_SQLLDR_TABLE') 
      execute immediate 'drop table TMP_SQLLDR_TABLE'; 
    end if ;
      

  5.   

    哎,还是报错,无效的SQL语句
      

  6.   

    if exists (select 1 from all_tables where table_name='TMP_SQLLDR_TABLE') 
      drop table tmp_sqlldr_Table 
      

  7.   

    一群拍脑袋说话的家伙,注意这里是oracle语句,不是SqlServer语句