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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: