因为你所drop的table是关系表,它有子表存在,你去查一查,
先删除子表再删它就可以了

解决方案 »

  1.   

    你需要先alert掉子表的关系,然后再删除主表。
      

  2.   

    当然没有主从关系
    SQL> declare 
      2   num integer;
      3   begin
      4     select count(name) into num from tt;
      5    if num >0 then
      6     begin
      7      drop table test;
      8     end ;
      9   end if ;
     10   end;
     11  /
        drop table test;
        *
    ERROR 位于第 7 行:
    ORA-06550: 第 7 行, 第 5 列:
    PLS-00103: 出现符号 "DROP"在需要下列之一时:
    begincasedeclareexitfor
    gotoifloopmodnullpragmaraisereturnselectupdatewhilewith
    <an identifier><a double-quoted delimited-identifier>
    <a bind variable><<closecurrentdeletefetchlockinsertopen
    rollbacksavepointsetsqlexecutecommitforallmerge
    <a single-quoted SQL string>pipeSQL> Create procedure proc_tt
      2  as
      3    begin
      4     drop table tt;
      5   end ;
      6  /警告: 创建的过程带有编译错误。
      

  3.   

    declare 
      2   num integer;
          v_sql string(100);
      3   begin
      4     select count(name) into num from tt;
      5    if num >0 then
      6     begin
             v_sql:='drop table test';
      7      execute immediate v_sql;
      8     end ;
      9   end if ;
     10   end;
     11  /
        drop table test;
      

  4.   

    1.权限不足
    2.需执行动态sql语句删除表或创建表像“相逢何必曾相识“所说的