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: Atul Kane <akkane_at_worldnet.att.net>
Date: Thu, 23 Apr 1998 23:51:05 -0400
Message-ID: <6hpcr7$b1q@bgtnsc02.worldnet.att.net>


I have seen a DBA tool (DB Artisian) display the Current values of Sequences. does it do nextval for every sequence ? or does it read frrom system tables/views ?

Bill Dietrich wrote:

> Yes, that is exactly what I'm doing as a work-around, but
> that seems a lot less efficient than just reading a single
> value (the sequence.CURRVAL).
>
> Bill Dietrich
> bill_dietrich_at_wayfarer.com
>
> Venkat wrote:
>
> > er... Pardon my asking but can't you read the max value from the table and
> > compare it to the previous max to see if new rows have been added ?
> >
> > Venkat
> >
> > >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 can't believe sequences have this behavior !
Received on Thu Apr 23 1998 - 22:51:05 CDT

Original text of this message

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