create or replace procedure simo_pro as
begin
declare
isHas number;
cursor table_input(varchar inid) is
select id,name from simo_tab where id = inid
begin
select count(1) into isHas from user_tables where table_name='大写表名';
if isHas>0 then
execute immediate 'delete table '||'大写表名'; --删除表数据
end if;
execute immediate 'create table....'; --创建表
open table_input('1') ;--传入参数
loop
fetch base_stu_in into stu_in;
exit when base_stu_in%NOTFOUND;
begin
... --你的数据插入操作
end;
end loop;
close table_input;
end;
end simo_pro;
begin
declare
isHas number;
cursor table_input(inid varchar2) is
select id,name from simo_tab where id = inid;
input table_input%ROWTYPE;
begin
select count(1) into isHas from user_tables
where table_name='大写表名';
if isHas>0 then
execute immediate 'delete table '||'大写表名'; --删除表数据
end if;
execute immediate 'create table....'; --创建表
open table_input('1') ;--传入参数
loop
fetch table_input into input;
exit when table_input%NOTFOUND;
begin
...; --你的数据插入操作
end;
end loop;
close table_input;
end;
end simo_pro;