I am using DB2 v9 in LUW.
I have a column defined as follows:
"ID" BIGINT NOT NULL GENERATED BY DEFAULT
AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20,
NO MINVALUE, NO MAXVALUE, NO CYCLE, NO ORDER),
I would like to know how best to determine what next value will be for the identifier column the next time the record is inserted into the table.
I will use this information to write a script to do a sanity check on the table that IDENTITY is still untouched and that its next value is greater than the highest value in the ID column.
I don't want to just reset the value blindly. If the table does not pass the health check, I want to receive a notification so that I can determine what causes the IDENTITY authentication.