declare
tablecount number;
begin
tablecount:=1000;
while tablecount>0 loop
execute immediate 'create table riskset_'||tablecount||' as select * from riskset';
tablecount:=tablecount-1;
end loop;
end;
本文介绍了一段使用PL/SQL编写的代码,该代码可以批量创建指定数量的表,并为每个表命名。具体操作包括声明变量、设置初始数值、利用循环结构执行创建表的命令等。
declare
tablecount number;
begin
tablecount:=1000;
while tablecount>0 loop
execute immediate 'create table riskset_'||tablecount||' as select * from riskset';
tablecount:=tablecount-1;
end loop;
end;
1086

被折叠的 条评论
为什么被折叠?