标签:
杂谈 |
分类: oracle |
确保权限:
select * from dba_role_privs where grantee='LOGANALYSER';
创建存储过程:
create or replace procedure p_create_table
is
v_count number(10);
tableName VARCHAR2(20);begin
tableName := 'LOGDETAILS_'||to_char( sysdate,'yyyymmdd' );
--oracle存储过程实现mysql语法中的drop table table_name if exists
select count(*)
into v_count
from user_objects
where object_name = upper( tableName);
if v_count > 0 then
execute immediate 'drop table ' || tableName ||' cascade constraints';
end if;