if i=0 then
   execute immediate 'CREATE TABLE T3(ID     NUMBER  NOT NULL,
                             PRICE  NUMBER  NOT NULL)';
...

解决方案 »

  1.   

    改成这样了i integer;select count(*) into i  from user_tables where table_name='T3';
     
    if i=0 then
      execute immediate 'CREATE TABLE T3(ID     NUMBER  NOT NULL, PRICE  NUMBER  NOT NULL)';
    end if;但会说Error on line 2
    select count(*) into i  from user_tables where table_name='T3'ORA-00905: 缺少关键字
      

  2.   

    加分再问,不在存储过程里如何实现这样的功能?select count(*) into i  from user_tables where table_name='T3'
      

  3.   

    declare
    i integer;
    begin
    select count(*) into i  from user_tables where table_name='T3';
     
    if i=0 then
      execute immediate 'CREATE TABLE T3(ID     NUMBER  NOT NULL, PRICE  NUMBER  NOT NULL)';
    end if;
    end;
    /
      

  4.   

    就是上面高手回答的了。
    declare 
     ......
     begin 
       ......
     end;