Home » SQL & PL/SQL » SQL & PL/SQL » Error 0RA01031
Error 0RA01031 [message #302] Mon, 04 February 2002 07:25 Go to next message
INTROV -help
Messages: 1
Registered: February 2002
Junior Member
I am running this procedure after compilation and gets insufficient privileges errors.

create or replace procedure create_test_tab as
v_sql_stmt varchar2(2000);
v_cnt number;

v_sql_stmt := 'create table test_tab(
x number,
y number,
a varchar2(20))';
execute immediate v_sql_stmt;

for v_cnt in 1..5
v_sql_stmt := 'insert into test_tab
values(:1, :2, :3)';
execute immediate v_sql_stmt
using v_cnt,v_cnt + 1.0, 'a'||to_char(v_cnt);
end loop;

ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "INTROV.CREATE_TEST_TAB", line 10
ORA-06512: at line 1

What privileges do we need in order to execute the above procedure.
Re: Error 0RA01031 [message #307 is a reply to message #302] Mon, 04 February 2002 11:00 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
create table privilege need to be granted to procedure owner directly, not through role.

SQL> grant create table to introv;
Previous Topic: Incomprehensible sqlplus error
Next Topic: suresh
Goto Forum:

Current Time: Mon Sep 27 05:00:15 CDT 2021