执行某个存储过程时报错:ora-01031: insufficient privileges。 调试存储过程,发现在存储过程运行到创建表的这一步时出错,意即没有权限创建表,但实际上执行这个存储过程的用户是有创建表的权限的,在网上得到解决方法,在存储过程中添加如下内容即可:aut
执行某个存储过程时报错:ora-01031: insufficient privileges。
调试存储过程,发现在存储过程运行到创建表的这一步时出错,意即没有权限创建表,但实际上执行这个存储过程的用户是有创建表的权限的,在网上得到解决方法,在存储过程中添加如下内容即可:authid current_user,修改后的存储过程结构如下:
create or replace procedure its_kk.pro_create_table_yhx authid current_user
is
begin
execute immediate 'create table aaa(id number(8),name varchar2(10)) ';
-- commit;
exception
when no_data_found
then
null;
when others
then
raise;
end pro_create_table_yhx;
/