creating a sequence inside a procedure
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: creating a sequence inside a procedure

  1. #1
    Join Date
    Sep 2001
    Posts
    9
    hi guys,

    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
    AS
    drop_stmt varchar2(200) := 'DROP SEQUENCE SEQ_TEST';
    create_stmt varchar2(200) := 'CREATE SEQUENCE SEQ_TEST';
    BEGIN
    EXECUTE IMMEDIATE drop_stmt;
    EXECUTE IMMEDIATE create_stmt;
    END;

    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?

    thanks...

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    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.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    Sep 2001
    Posts
    9
    THANKS A BUNCH!!!

    it worked... funny, i'd really like to know why but... as long as it works, right?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width