Db2

Db2

Where DBAs and data experts come together to stop operating and start innovating. Connect, share, and shape the AI era with us.


#Data


#Data
#Databases
#Operatingsystems
#Db2
#Databasesolutions
 View Only

Incorrect SYSCAT.SEQUENCES.NEXTCACHEFIRSTVALUE value right after the "ALTER SEQUENCE ... RESTART WITH xxx" statement

  • 1.  Incorrect SYSCAT.SEQUENCES.NEXTCACHEFIRSTVALUE value right after the "ALTER SEQUENCE ... RESTART WITH xxx" statement

    Posted 06/15/23 09:09 AM

    Hello All,

    `NEXTCACHEFIRSTVALUE` gets equal to `START` in the corresponding record of `SYSCAT.SEQUENCES` right after the `ALTER SEQUENCE myseq RESTART WITH xxx` statement before the first subsequent `NEXTVAL FOR myseq` call.
    The drawback is, that it's impossible to generate correct `ALTER SEQUENCE myseq RESTART WITH xxx` statement on such a sequence, if `NEXTVAL` hasn't been called after `ALTER SEQUENCE` - there is no way to find this `xxx` value in the system catalog in this case.

    Is this "feature" documented somewhere?



    ------------------------------
    Mark Barinstein
    ------------------------------