Skip to Main Content

SQL & PL/SQL

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!

insufficient privilege while creating sequence using procedure

Ora-affAug 27 2015 — edited Aug 28 2015

CREATE OR REPLACE PROCEDURE schema1.proc1 AS

BEGIN

EXECUTE IMMEDIATE 'DROP SEQUENCE schema1.add_ins_seq';

EXECUTE IMMEDIATE 'CREATE SEQUENCE schema1.add_ins_seq MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 1000 NOORDER  NOCYCLE';

END;

This procedure is created in schema1 by schema1.

schema1 has been granted CREATE SEQUENCE privilege.

When I run this procedure through SQL Developer after logging into schema1, an error insufficient privilege is thrown at CREATE SEQUENCE, however, DROP SEQUENCE is executed. I can create the sequence without calling the procedure.

If I add AUTHID CURRENT_USER then I don't get the insufficient privilege error.

Why it is giving this error when the owner and the invoker of the procedure is schema1?

This post has been answered by BrunoVroman on Aug 27 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2015
Added on Aug 27 2015
10 comments
1,790 views