使用存储过程来解决先找到你需要的表空间
然后使用动态sql来建表

解决方案 »

  1.   

    通过动态sql 就可以拉
    str:='create table ... tablespace ';
    select tablesapce_name into v_tablespace from ...;
    str:=str||'v_tablespace;
    execute immediate str;
      

  2.   

    declare
    str varchar2(100);
    cursor t_sor is
    select tablespace_name from all_tables a,user_users b where b.USERNAME=a.owner
    and a.table_name='ZY';
    begin
    str:='create table try (try number(8)) tablespace';
    for v_sor in t_sor loop
    str:=str||' '||v_sor.tablespace_name;
    end loop;
    execute immediate str;
    end;
    /