I found a very interesting thing while working with sequences. I needed some professional help with the following issue so I came to this forum.

First I created a sequence with any name. I ran the nextval and currval command and it's working perfectly, but the problem starts when I try to create another sequence with the same name. As expected it won't create a new sequence, as the object already exists, but what it does is give junk values to the already created sequence. Ideally it shouldn't touch the previous sequence but here it does.

If anybody has any idea why it does, I would like to hear it. Thanks.

    Requires Free Membership to View

Oracle does not allow multiple sequences with the same name.

Are you using the "cache" option for the sequence definition? If so, there are known issues:

http://www.arikaplan.com/oracle/ari82599.html

In any case, getting a "sequence already exists" message should not corrupt the existing sequence. I would log an iTar on Oracle MetaLink and see if there is a bug.

This was first published in October 2005

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.