473,788 Members | 2,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List sequences?


Folks,

I have created bunch of sequences in DB2 7.2.

How do I list all the defined sequences and if possible their current values?

Thanks.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@ xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #1
4 52344
Hi Hemant,
How do I list all the defined sequences and if possible their current values?


select *
from syscat.sequence s;

Should give you everything you need to know about the sequences.

Christian.
Nov 12 '05 #2
You can get the list of sequences from syscat.sequence s however
There is no way to get the current value of the sequence unless you
have already updated it in the current session.

To get the next value for a sequence :
VALUES NEXTVAL FOR <seq-name>

To get the last value for a sequence:
VALUES PREVVAL FOR <seq-name>

The PREVVAL command won't give you the correct answer unless you have
already accessed (and thus incremented) the sequence in your current
session using the NEXTVAL command.
Thanks
Amit
singleton at canada.com
ch************* *@techie.com (Christian Maslen) wrote in message news:<b9******* *************** ****@posting.go ogle.com>...
Hi Hemant,
How do I list all the defined sequences and if possible their current values?


select *
from syscat.sequence s;

Should give you everything you need to know about the sequences.

Christian.

Nov 12 '05 #3
If you dig deeper into SYSIBM.SYSSEQUE NCES there is a field containing
the next batch to be allocated for the cache.
Two cave-at:
1. SYSIBM.SYS* is undocumented on purpose. These tables may change
without warning on any full release upgrade.
2. This value is really just an upper boundary. While you know the
highest generated values so far was in the preceeding CACHE range, In an
MPP system may thow soem really old values at you from a node that works
of an old cache.

Note that sequences are a performance feature. The only way to get more
acurate is to use NO CACHE. But you will feel the impact.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #4
While stranded on information super highway Christian Maslen wrote:
Hi Hemant,
How do I list all the defined sequences and if possible their current values?


select *
from syscat.sequence s;

Should give you everything you need to know about the sequences.

Christian.


Thanks. I will try that.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@ xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #5

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

Similar topics

13
2660
by: Santanu Chatterjee | last post by:
Hello everybody, I am very new to python. I have a query about list in python. Suppose I have a list a = ,5,6,7,,11,12] I want to know if there is any simple python facility available that would expand the above list to give
34
3298
by: jblazi | last post by:
Let us assume I have a list like and would like to transoform it into the string '{1,2},{7,8},{12,13}' Which is the simplest way of achiebing this? (The list is in fact much longer and I may have to cut the resulting strings into chunks of 100 or
6
1683
by: kartik | last post by:
Escape sequences don't seem to work in strings within list comprehensions: >>> print ] What am I missing? Thank you.
4
2320
by: temp | last post by:
Hi All, I wonder could someone help me with this? What I want to do is search through a list of letters and look for adjacent groups of letters that form sequences, not in the usual way of matching say abc to another appearance later on in the list but to look for transposed patterns. The groups of letters can be made up of between 2 to 4 letters.
32
2796
by: Robin Becker | last post by:
Is there some smart/fast way to flatten a level one list using the latest iterator/generator idioms. The problem arises in coneverting lists of (x,y) coordinates into a single list of coordinates eg f() --> or g(,) -->
72
5583
by: Gregory Petrosyan | last post by:
Please visit http://www.python.org/peps/pep-0204.html first. As you can see, PEP 204 was rejected, mostly because of not-so-obvious syntax. But IMO the idea behind this pep is very nice. So, maybe there's a reason to adopt slightly modified Haskell's syntax? Something like --> (1,3..10) --> same values as above, but return generator instead of list
35
29232
by: erikwickstrom | last post by:
Hi all, I'm sorry about the newbie question, but I've been searching all afternoon and can't find the answer! I'm trying to get this bit of code to work without triggering the IndexError. import shutil, os, sys
4
2988
by: dustin.getz | last post by:
consider the following working loop where Packet is a subclass of list, with Packet.insert(index, iterable) inserting each item in iterable into Packet at consecutive indexes starting at index. i=0 while(i<len(packet)-4): if packet==Packet("01110"): packet.insert(i, "01111") i+=10 #skip the 5 bits inserted, and skip the 5 bits just checked bc overlap should not trigger insertion
122
5535
by: C.L. | last post by:
I was looking for a function or method that would return the index to the first matching element in a list. Coming from a C++ STL background, I thought it might be called "find". My first stop was the Sequence Types page of the Library Reference (http://docs.python.org/lib/typesseq.html); it wasn't there. A search of the Library Reference's index seemed to confirm that the function did not exist. A little later I realized it might be called...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
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
6750
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();...
1
4070
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
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.