This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).
We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:
Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,
Post an idea.
Get feedback from the IBM team and other customers to refine your idea.
Follow the idea through the IBM Ideas process.
Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.
IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.
ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.
An identity value is by definition not unique. This is true in the ANS and ISO standard and true for Db2 for z/OS and Db2 for LUW as well.
Even if you do not specify CYCLE, you still could get duplicate values if you use OVERRIDING SYSTEM VALUE on INSERT or UPDATE.
If you want identity columns to be guaranteed to be unique you must either add a unique constraint to the column or create a unique index.
In either case, you would then choose whether you want NULL values to be considered to be unique or not.
NO CYCLE is the default when you create a table. The documentation in CREATE TABLE already points out the possibility of duplicate keys:
CYCLE
Specifies that values continue to be generated for this column after the maximum or minimum value has been reached. If this option is used,
after an ascending sequence reaches the maximum value of the sequence, it generates its minimum value. After a descending sequence
reaches its minimum value of the sequence, it generates its maximum value. The maximum and minimum values for the column determine
the range that is used for cycling.
When CYCLE is in effect, duplicate values can be generated by the database manager for an identity column. If a unique constraint or
unique index exists on the identity column, and a non-unique value is generated for it, an error occurs.
I agree with Josys36. That is not part of the database itself.
IMHO it should be handled at the application layer. If you still need a not-used id on the next "call" then use a SQL sequence and roll your own. Not that hard.
I don't agree with this request. I agree it would be nice if Navigator did some of these things. But, in all database products there are things that a database engineer is just going to have to know. That is why we always make our ID fields large enough to compensate for roll over.