结束后,打一个“/”
countq number 后面应该有个分号

解决方案 »

  1.   

    Create or Replace procedure p_test
    as
    countq number
    begin
    select  count(table_name) into countQ from all_tables where table_name='test';
    if(countQ>0) then 
      execute immediate 'drop table test';
    end if;
    end;
    /
      

  2.   

    包兄已经说明白了。
    多了个declare;
    if语句少了一个then;
    if结束少了一个end if;
    drop table……不能直接这样写。
      

  3.   

    谢谢,包子兄,编译已通过了。
    现在还有一个问题是,为什么这个存储过程成功的执行了之后,test表还存在呢?
      

  4.   

    很可能是表名的原因
    ……where table_name='TEST';
    试试
      

  5.   

    我用下面这条语句查询时,结果如下:
    SQL> select * from all_tables where table_name='test';未选定行但是如果我用
    select * from test却能从这个表中读出相应的记录。不知何故,我是最近才开始接触Oracle的,感谢不吝赐教!
      

  6.   

    select * from all_tables where table_name='TEST';试试大写的表名啊,看有没有记录