第1个回答 2014-06-12
declare
ls_table_name varchar2(200);
begin
for i in 1..100 loop
begin
ls_table_name:='table'||to_char(i);
execute immediate 'create table '||ls_table_name||' (id number(8))';
execute immediate 'Insert into '||ls_table_name||' (id) values(:1)' using i;
exception when others then rollback;
end;
end loop;
commit;
end;