可以先去DD中查询是否有这个table

解决方案 »

  1.   

    你可以通过系统视图(SYS.USER_TABLES),检索一下。看一下结果,就可以知道,有没有这个表。注意,表名要大写。
      

  2.   

    select count(*) into count from user_tables where table_name=UPPER(report_answer');
    if count = 1 then
      execute immediate 'drop table report_answer';
    end if;
      

  3.   

    赞同
    skystar99047(天星) 的做法
      

  4.   

    返回错误 :
    行号= 19 列号= 4 错误文本= PLS-00204: 函数或伪列 'COUNT' 只能在 SQL 语句中使用
    行号= 19 列号= 1 错误文本= PL/SQL: Statement ignoredcount我已经定义过了
      

  5.   

    你误会我的意思了
    count就是专门为了您写的语句定义的变量——如果不定义,回报错
    所以我就定义了。
      

  6.   

    加一句定义参数: 
    declare 
       table_count number;
    select count(*) into table_count from user_tables where table_name=UPPER(report_answer');
    if table_count = 1 then
      execute immediate 'drop table report_answer';
    end if;
      

  7.   

    ...UPPER(report_answer')...
    漏了个'