日期:2014-05-17 浏览次数:20711 次
create or replace procedure simo_pro as
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;