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 8943
On Jul 22, 1:19 pm, aj <ron...@mcdonal ds.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_SCHEM A.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.SEQUENCE S.NEXTCACHFIRST VALUE
If you don't have it on your version look in SYSIBM.SEQUENCE S
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Serge: thx for reply.
There is no SYSCAT.SEQUENCE S.NEXTCACHFIRST VALUE,
and SYSIBM.SEQUENCE S 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.SEQUENCE S.NEXTCACHFIRST VALUE
If you don't have it on your version look in SYSIBM.SEQUENCE S
Cheers
Serge
On Jul 23, 8:09*am, aj <ron...@mcdonal ds.comwrote:
Serge: *thx for reply.
There is no SYSCAT.SEQUENCE S.NEXTCACHFIRST VALUE,
and SYSIBM.SEQUENCE S 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.SEQUENCE S.NEXTCACHFIRST VALUE
If you don't have it on your version look in SYSIBM.SEQUENCE S
Cheers
Serge- Hide quoted text -
- Show quoted text -
Try SYSIBM.SYSSEQUE NCES
/T
This is just what I needed. Thanks Tomas.
Tomas wrote:
On Jul 23, 8:09 am, aj <ron...@mcdonal ds.comwrote:
>Serge: thx for reply.
There is no SYSCAT.SEQUENCE S.NEXTCACHFIRST VALUE, and SYSIBM.SEQUENCE S 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.SEQUEN CES.NEXTCACHFIR STVALUE If you don't have it on your version look in SYSIBM.SEQUENCE S Cheers Serge- Hide quoted text -
- Show quoted text -
Try SYSIBM.SYSSEQUE NCES
/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 candidate for a primary key which we all know it's not.
Now I want to add a new field, i.e. called ID, with a normal number
sequence as primary key.
I have dropped the primary key, created the new column, created the
new sequence and created...
|
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 for it eg:
|
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 point an object shall have its
stored value modified at most once by the evaluation of an expression.
Furthermore, the prior value shall be read only to determine the value
|
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 object shall have its
stored value modified at most once by the evaluation of an expression.
Furthermore, the prior value shall be accessed only to determine the
value to be stored."
Can someone give me examples of expressions that "barely"...
|
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,
"someotherfield" TEXT,
PRIMARY KEY("serialfield")
|
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 uses errno,
modified by right operand): (log(x) - mu) * (log(x) - mu)
Code has unspecified behavior. Order of evaluation of function
parameters or
subexpressions is not defined, so if a value is used and
|
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 array data from 0 to3, I get this {13, JUNK VALUE, 17,38, 18} and JUNK VALUE is like 1.8e831 or something like that.
This happens when I use the attach() function and use the current() function to display the values at data
I really want to...
|
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.
The statement "Select prevval for <seq_namefrom sysibm.sysdummy1"
gives the value of previous correctly generated value only if the
|
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, 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...
| |
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,...
|
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...
|
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...
|
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...
|
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 we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |