473,785 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to find the next sequence of the db2 generated field in the syscat catalog table on db2 mainframe and db2 udb

Hi,
We have some tables with db2 generated field.
How can I find the next generated sequence fot those fields.
Thanks,

Jan 23 '07 #1
5 11541
I need to find those information on db2 mainframe and also db2 udb.
zgh1970 wrote:
Hi,
We have some tables with db2 generated field.
How can I find the next generated sequence fot those fields.
Thanks,
Jan 23 '07 #2
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.SYSSEQUE NCES. 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
Jan 23 '07 #3
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.SYSSEQUE NCES. 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
Jan 24 '07 #4
zgh1970 wrote:
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.
All right. Then why not simply do NEXT VALUE FOR <sequence>?
Followed by:
ALTER SEQUENCE <sequenceRESTAR T WITH <thevalueyoujus tgot>

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jan 24 '07 #5
Hi, Serge,
With your help, I had the query to find the stert key.
IT is very convenient to check the db2 generated fileds work after bulk
load.
thanks again,

On Jan 23, 9:48 pm, Serge Rielau <srie...@ca.ibm .comwrote:
zgh1970 wrote:
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.All right. Then why not simply do NEXT VALUE FOR <sequence>?
Followed by:
ALTER SEQUENCE <sequenceRESTAR T WITH <thevalueyoujus tgot>

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jan 24 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1947
by: nekiv90 | last post by:
Greetings, I was able to create the structured type: CREATE TYPE address_t AS ( street char(30), city char(15), state char(10), postcode smallint ) MODE DB2SQL;
3
8110
by: Bob Stearns | last post by:
I changed a varchar(255) to varchar(3000) an started receiving: Warning: odbc_exec(): SQL error: SQL1585N A system temporary table space with sufficient page size does not exist. SQLSTATE=54048 , SQL state 54048 in SQLExecDirect in /var/www/html/GEM/animalEdit/animals_priv.php on line 207 Where do I find out more about the attributes of my temporary table space and how to change them? Just RTFM is insufficient given the size of TFM.
4
17098
by: John Bailo | last post by:
I have created several aliases to members using the CREATE ALIAS command, but I lost track of them. Now I want to see a catalog of all the aliases mapped to all members in a FILE. Is there a SQL commmand I can issue to see these?
2
14935
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data in the format that I need it in order to create the reports that we use. So far this has proven to be successful for the reports that I am doing and the data that I am pulling into it. I just have one challenge that may require a lot of work and I...
2
1420
by: gaffar | last post by:
Hello Sir, How to assign more than one primary key to table by this below following code. i am able assign to a single field only. how to assign primary key to more than one field. the primary key assigning code line is symboled kept with in the *************** in the below code. 'Creating database Dim cat As Catalog = New Catalog
9
17032
by: Hemant Shah | last post by:
How do I find out when the table was modified? When I look at syscat.tables it only lists creation time. -- Hemant Shah /"\ ASCII ribbon campaign E-mail: NoJunkMailshah@xnet.com \ / --------------------- X against HTML mail TO REPLY, REMOVE NoJunkMail / \ and postings
7
18311
by: Laurence | last post by:
Hi folks, Who knows how to retrieve the owner of SQL objects, such as SCHEMA, TABLE etc.? Is GRANTOR within catalog view owner? Thanks, Laurence
10
4998
by: Lennart | last post by:
I see a bunch of packages where valid <'Y'. What I cant figure out is how to relate the package to a procedure, function or whatever. Does anyone have a reference to share on the relationship between, say syscat.packages and syscat.routines. If anyone have sql for this I can live with that too :-) /Lennart
15
10832
by: uwcssa | last post by:
I try to drop a table as: I got: During SQL processing it returned: SQL0478N The object type "TABLE" cannot be dropped because there is an object "sch.SQL070515104729271", of type "FUNCTION", which depends on it. SQLSTATE=42893 Then I tried to do
0
10319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10087
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.