判断当前数据库是否有表CAP_LOG_变量,如果有,删除后新建,如果没有直接新建
create or replace procedure pro_createtable(
filename varchar2
)
authid current_user is --授予调用者在存储过程中拥有其角色权限
num number;
begin
select count(1) into num from user_tables where table_name ='CAP_LOG_'||filename;
if num > 0 then
execute immediate 'drop table cap_log_'||filename;
end if;
execute immediate 'create table cap_log_'||filename||' as select * from cap_log';
end pro_createtable;