DB2 LUW 8.1 fixpak 14
Linux Red Hat AS
I'm trying to get the maximum value of a sequence. Because of the way
the sequence is used (on several tables comprising a fat view), its too
expensive to do the usual
select max(<col>) from <view;
Is there some way for the system catalogs or some trick to get me the
maximum value of the sequence?
Note that I'm on DB2 LUW 8.1 fixpak 14. There's apparently some
sequence highwater column in v9, but I don't think I have it.
tia
aj 7 8831
On Jul 22, 1:19 pm, aj <ron...@mcdonalds.comwrote:
DB2 LUW 8.1 fixpak 14
Linux Red Hat AS
I'm trying to get the maximum value of a sequence. Because of the way
the sequence is used (on several tables comprising a fat view), its too
expensive to do the usual
select max(<col>) from <view;
Is there some way for the system catalogs or some trick to get me the
maximum value of the sequence?
Note that I'm on DB2 LUW 8.1 fixpak 14. There's apparently some
sequence highwater column in v9, but I don't think I have it.
tia
aj
You can see the next value (that would have been assigned), which is
presumably one more than the present "maximum value" by running the
following:
VALUES NEXTVAL FOR <YOUR_SEQ_SCHEMA.YOUR_SEQ_NAME>;
--Jeff
aj wrote:
DB2 LUW 8.1 fixpak 14
Linux Red Hat AS
I'm trying to get the maximum value of a sequence. Because of the way
the sequence is used (on several tables comprising a fat view), its too
expensive to do the usual
select max(<col>) from <view;
Is there some way for the system catalogs or some trick to get me the
maximum value of the sequence?
Note that I'm on DB2 LUW 8.1 fixpak 14. There's apparently some
sequence highwater column in v9, but I don't think I have it.
tia
aj
SYSCAT.SEQUENCES.NEXTCACHFIRSTVALUE
If you don't have it on your version look in SYSIBM.SEQUENCES
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Serge: thx for reply.
There is no SYSCAT.SEQUENCES.NEXTCACHFIRSTVALUE,
and SYSIBM.SEQUENCES does not exist....???
Any other ideas?
aj
Serge Rielau wrote:
aj wrote:
>DB2 LUW 8.1 fixpak 14 Linux Red Hat AS
I'm trying to get the maximum value of a sequence. Because of the way the sequence is used (on several tables comprising a fat view), its too expensive to do the usual select max(<col>) from <view;
Is there some way for the system catalogs or some trick to get me the maximum value of the sequence?
Note that I'm on DB2 LUW 8.1 fixpak 14. There's apparently some sequence highwater column in v9, but I don't think I have it.
tia
aj
SYSCAT.SEQUENCES.NEXTCACHFIRSTVALUE
If you don't have it on your version look in SYSIBM.SEQUENCES
Cheers
Serge
On Jul 23, 8:09*am, aj <ron...@mcdonalds.comwrote:
Serge: *thx for reply.
There is no SYSCAT.SEQUENCES.NEXTCACHFIRSTVALUE,
and SYSIBM.SEQUENCES does not exist....???
Any other ideas?
aj
Serge Rielau wrote:
aj wrote:
DB2 LUW 8.1 fixpak 14
Linux Red Hat AS
I'm trying to get the maximum value of a sequence. *Because of the way
the sequence is used (on several tables comprising a fat view), its too
expensive to do the usual
select max(<col>) from <view;
Is there some way for the system catalogs or some trick to get me the
maximum value of the sequence?
Note that I'm on DB2 LUW 8.1 fixpak 14. *There's apparently some
sequence highwater column in v9, but I don't think I have it.
tia
aj
SYSCAT.SEQUENCES.NEXTCACHFIRSTVALUE
If you don't have it on your version look in SYSIBM.SEQUENCES
Cheers
Serge- Hide quoted text -
- Show quoted text -
Try SYSIBM.SYSSEQUENCES
/T
This is just what I needed. Thanks Tomas.
Tomas wrote:
On Jul 23, 8:09 am, aj <ron...@mcdonalds.comwrote:
>Serge: thx for reply.
There is no SYSCAT.SEQUENCES.NEXTCACHFIRSTVALUE, and SYSIBM.SEQUENCES does not exist....???
Any other ideas? aj Serge Rielau wrote:
>>aj wrote: DB2 LUW 8.1 fixpak 14 Linux Red Hat AS I'm trying to get the maximum value of a sequence. Because of the way the sequence is used (on several tables comprising a fat view), its too expensive to do the usual select max(<col>) from <view; Is there some way for the system catalogs or some trick to get me the maximum value of the sequence? Note that I'm on DB2 LUW 8.1 fixpak 14. There's apparently some sequence highwater column in v9, but I don't think I have it. tia aj SYSCAT.SEQUENCES.NEXTCACHFIRSTVALUE If you don't have it on your version look in SYSIBM.SEQUENCES Cheers Serge- Hide quoted text -
- Show quoted text -
Try SYSIBM.SYSSEQUENCES
/T
Sorry.. sleep deprived.
Have been standing on the Newark runway half of last night :-(
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
No problem Serge - I appreciate all the help you provide. :)
Long layovers are no fun...
Serge Rielau wrote:
Sorry.. sleep deprived.
Have been standing on the Newark runway half of last night :-(
Cheers
Serge This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Ken1 |
last post by:
I am going to drop a primary key from one column and create a new
column to be used as primary key in an existing database.
The old column was a date column which someone earlier though was a
good...
|
by: Anthony Best |
last post by:
I'm working on an idea that uses sequences.
I'm going to create a table like this:
id serial,
sequence int,
keyword varchar(32),
text text
for every keyword there will be a uniq sequence...
|
by: j |
last post by:
In a footnote in the c99 standard the following is labeled as
undefined:
a = i;
And in the second clause of section 6.5 the following is stated:
"Between the previous and next sequence...
|
by: Deniz Bahar |
last post by:
I know the basic definition of a sequence point (point where all side
effects guaranteed to be finished), but I am confused about this
statement:
"Between the previous and next sequence point an...
|
by: akarl |
last post by:
Hi all,
Why do I get a warning from gcc with the following program?
$ cat test.c
#include <stdio.h>
int f(int n)
{
return n;
| |
by: Marek Lewczuk |
last post by:
Hello,
I would like to ask if my problem with sequence is a proper behavior or
this is a bug (probably not)...
I have a table:
CREATE TABLE "testtable" (
"serialfield" SERIAL,...
|
by: John Smith |
last post by:
I've been playing with splint, which returns the following
warning for the code below:
statlib.c: (in function log_norm_pdf)
statlib.c(1054,31): Expression has undefined behavior (left
operand...
|
by: davydany |
last post by:
Hey guys...a n00b Here for this site.
I'm making a sequence class for my C++ class. And The thing is in the array that I have, lets say i put in {13,17,38,18}, when i see the current values for the...
|
by: Rahul B |
last post by:
Hi,
If i do a "Select nextval for <seq_namefrom sysibm.sysdummy1",
it increases the values of nextval by1.
How can i find out the nextval of a sequence without actually
increasing the value....
|
by: =?ISO-8859-1?Q?Marcel_M=FCller?= |
last post by:
Hi,
I have a question about the execution sequence of the postfix increment
operator with respect to a function call.
void foo(int type, int*& data);
int* sequence;
|
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,...
| |
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,...
|
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...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |