Hi, Serge,
thank you for the information.
But peeking the next valus is also useful in the data ware house.
I am sure no any change to those tables with db2 generated fields.
Sometimes dba need to dump data from production to UAT.
We want to check if we missed any adjustment to the start key after
loading.
If I can find the start key or next key for those tables synchronized
from production instance to test instance.
I know Db2 UDB we can alter table to change the start key.
For the db2 mianframe we need ot create table with the stark key equal
the maximum +1 of the data loaded.
I would to get start key or next sequence for those fields.
Thansk,
On Jan 23, 6:14 pm, Serge Rielau <srie...@ca.ibm.comwrote:
zgh1970 wrote:
Hi,
We have some tables with db2 generated field.
How can I find the next generated sequence fot those fields.
Thanks,You won't be able to peek the next value.
There are semantic reasons as well as practical.
First of all there is no locking for sequence values.
That is if you check the next value the information you would obtain
would be outdated right away. Anyone could steal that value.
Secondly depending on the implementation there may be more than one
cache. That is depending on where the sequence generating code executes
you could see different values. (Think sysplex or DB2 for LUW with DPF).
Having that said DB2 for LUW stored the high watermark in the catalog is
SYSIBM.SYSSEQUENCES. Chances are DB2 zOS does the same. The high
watermark is used by DB2 to issue the next set of cache values.
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab