Alter the sequence sign

If you change the sequence increment from positive to negative or vice versa, the system flushes the cache and the subsequent next value request can return an unexpected result. To avoid this, specify a new value through the RESTART WITH option on an ALTER SEQUENCE statement that changes the increment sign.

For example, suppose that you use your sequence generator for some time with the increment of 1 and the last cache load the system dispensed is 300,001 - 400,00. If you were to issue an ALTER SEQUENCE statement that sets the increment to -1, your next value would be 399999.

This value is equivalent to a final next value call that returns the last value in the cache (400,000). After you change the increment to -1, the next value call applies to the new increment (-1) to the last value returned (400,000) and so it is 399,999.