select tname from tab where tname = 'A';
if (sql%count < 1 ) then
  execute immediate 'create table A XXXXXX';以上要放在存储过程中,或者是匿名块

解决方案 »

  1.   

    写错了,貌似应该是 sql%rowcount
      

  2.   

    我很蠢啊!!没想到select * from tab,谢谢!!
      

  3.   

    declare 
      n_found integer;
    begin
     select count(*) into n_found from user_tables where table_name='表名';
     if n_found>0 then 
       dbms_output.put_line('have');
     else
       dbms_output.put_line('no');
     end if;  
    end;
      

  4.   

    更正一下
    declare 
      n_found integer;
    begin
     select nvl(count(*),0) into n_found from user_tables where table_name='CLASS';
     if n_found>0 then 
       dbms_output.put_line('have');
     else
       dbms_output.put_line('no');
     end if;  
    end;