Link to home
Start Free TrialLog in
Avatar of GoodName
GoodName

asked on

Insufficient privileges to create table in PL/SQL

Hi,

I have the issue with creating a table from pl/sql stored procedure  (Oracle 9i).

When I am trying to create a table from a procedure I get the following error :

exec RecInitialize ( 'TableName' );

ORA-01031: insufficient privileges
ORA-06512: at "POSINT.RECINITIALIZE", line 82
ORA-06512: at line 1

But If I run the same statement from TOAD directly it works without any issues:

begin        
    execute immediate   'drop table TableName';
   
       
    execute immediate   'create table TableName
                        (
                            BUSINESS_DATE   date               null,
                            STORE_NUMBER    number  ( 22, 5  ) null,
                            ACCOUNT_TYPE    varchar2( 32     ) null,
                            GL_CODE         varchar2( 6      ) null,
                            LINE_NUMBER     varchar2( 32     ) null,
                            ACCOUNT_CODE    varchar2( 32     ) null,
                            AMOUNT          number  ( 22, 10 ) null          
                        )';
end;

The same login.

Thanks for any help.
Avatar of YANN0S
YANN0S

Hello,
try adding
authid current_user in the procedure's declaration.
ASKER CERTIFIED SOLUTION
Avatar of YANN0S
YANN0S

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GoodName

ASKER

Thanks! With authid current_user it works fine.