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: Dave Wotton <Dave.Wotton_at_it.camcnty.no-spam.gov.uk>
Date: 24 Apr 1998 09:11:43 GMT
Message-ID: <6hpl0f$mvd@dns.camcnty.gov.uk>


>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 ?

Bill Dietrich <bill_dietrich_at_wayfarer.com> replied:
>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,

make sure you use an INDEX_DESC hint when obtaining the MAX value. Then the optimiser can get the maximum value with a single hit, rather than having to read the entire index to obtain the greatest value.

Dave.
--

To reply by email, remove the "no-spam" bit from my email address. Received on Fri Apr 24 1998 - 04:11:43 CDT

Original text of this message

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