i'm trying to create a sequence inside a procedure and it's not letting me. i tried to use "EXECUTE IMMEDIATE" by:
CREATE OR REPLACE PROCEDURE APPLE
drop_stmt varchar2(200) := 'DROP SEQUENCE SEQ_TEST';
create_stmt varchar2(200) := 'CREATE SEQUENCE SEQ_TEST';
EXECUTE IMMEDIATE drop_stmt;
EXECUTE IMMEDIATE create_stmt;
but it gives me an ora-01031 - insufficient priveleges error whenever i run the procedure. i have priveleges to "CREATE SEQUENCE" and "CREATE ANY SEQUENCE" and i'm using only one user throughout this process. it lets me drop the sequence but it doesn't let me create it?
03-21-2002, 09:33 AM
You have bin given CREATE SEQUENCE priviledge through some role. You must have it as a system priviledge granted directly to you if you want to create sequences from PL/SQL.
03-21-2002, 09:55 AM
THANKS A BUNCH!!!
it worked... funny, i'd really like to know why but... as long as it works, right?