Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Location
    Toronto, Canada
    Posts
    18

    Unhappy Unanswered: Create and drop sequence number in a Program Unit

    I hope someone can help me here.
    --
    I have a field in the procedure that should start from 1 at the start of the year. At the end of the year, I want to drop the sequence.
    I have to execute the procedure for records every year from 1996 to 2002.
    create sequence
    procedure(year)
    drop sequence

    I would appreciate any help here.
    Thanks in advance

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Create and drop sequence number in a Program Unit

    Originally posted by CKENTEBE
    I hope someone can help me here.
    --
    I have a field in the procedure that should start from 1 at the start of the year. At the end of the year, I want to drop the sequence.
    I have to execute the procedure for records every year from 1996 to 2002.
    create sequence
    procedure(year)
    drop sequence

    I would appreciate any help here.
    Thanks in advance
    BEGIN
    EXECUTE IMMEDIATE 'CREATE SEQUENCE myseq';
    procedure(year)
    EXECUTE IMMEDIATE 'DROP SEQUENCE myseq';
    END;
    /

    Note that the sequence must exist when you create the procedure, otherwise it won't compile (unless you are using dynamic SQL to select).

Posting Permissions

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