Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: reading sequence.CURRVAL

Re: reading sequence.CURRVAL

From: Till Hänisch <till.haenisch_at_rz.uni-ulm.de>
Date: Fri, 24 Apr 1998 12:38:46 +0200
Message-ID: <35406BB6.5BB1B91F@rz.uni-ulm.de>


Bill Dietrich wrote:

> I'm using Oracle 7.3..3, and I want my app to check every now and then
>
> to see if new records have been added to a table (without using
> triggers).
>
> What I'd like to do is just read sequence.CURRVAL, where
> this is a sequence that generates record IDs for the table. If
> CURRVAL
> has
> increased since the last time I read it, I know there are new records,
>
> and what range their IDs are in.
>
> But the documentation says "Note that before you use CURRVAL
> for a sequence in your session, you must first initialize
> the sequence with NEXTVAL." And it is true; I've tested it.
>
> This means that I can't just read CURRVAL; first I have to
> reference NEXTVAL, which increments the value ! I don't want
> to do this.
>
> Is there any other way to read CURRVAL without changing its value ?
>

I think, you can read the next value of a cached sequence from thev$_sequences view

> I can't believe sequences have this behavior !
>
> Bill Dietrich
> bill_dietrich_at_wayfarer.com

--



Till Haenisch till.haenisch_at_rz.uni-ulm.de

Universitaet Ulm
Organisation und Management von Informationssystemen Albert Einstein Allee 11
89069 Ulm

http://lomi.e-technik.uni-ulm.de


Received on Fri Apr 24 1998 - 05:38:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US