Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

User creation via stored procedure raises insufficient privileges exception

Andy FrédéricDec 7 2016 — edited Dec 7 2016

I created manually and granted manually the DBA role to an user named pta. Then I connected to pta. I created a stored procedure in the pta schema :

create or replace procedure create_user(login varchar2)

is

begin

    execute immediate 'create user ' || login || ' identified by 1';

end;

/

When I executed the stored procedure :

SQL> execute create_user('xxx');

then I got ORA-01031: insufficient privileges

Although when I wrote

SQL> create user xxx identified by 1;

then the user is created successfully.

So what is wrong ?

This post has been answered by John Thorton on Dec 7 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 4 2017
Added on Dec 7 2016
4 comments
743 views